Knowledge Base support case for Likno Web Modal Windows, abstracted and stripped of all user’s private info.
Initial Email From: Gus
Initial Email Subject: Modal windows with Submit button and return value
Support Case Month: February 2013
Hi Kostas,
How can I get a Web Modal window to activate with an Input type="Submit" or Type="Image" button with onclick? It works great with a Type="Button". And is there a way to return True/False (or any other value) to the onclick so a button can be used for validation or a Go/No Go from the modal window?
Thanks,
Gus
Reply From: Likno Customer Support
Dear Gus,
If you have this submit button in a form and want to show the form result inside the Modal Window, then there is a simple way to capture the “on submit” event. You just need to add the correct “target” to your form:
If you just want to show a standard Modal Window, then there are many ways to do this using the element ID, Class or “onclick” method:
For example: <input type=”image” onclick=”Modal_Window_1();” … />
Finally, regarding returning a value from the modal, this is not possible in the sense of a “confirm” dialog as the modal is not blocking the JavaScript execution.
Still it allows you to run any JavaScript code on exit, so you can do anything you like there (for example check a modal/page element value and act accordingly):
Best Regards,
Kostas
Likno Customer Support
www.likno.com
Powerful javascript menus (CSS menus/drop-down menus/sliding menus), web trees, buttons, tabs, modals, tooltips, accordions, scrollers, designs for your websites!
Tags: button, code, element, input, JavaScript, modal, modal window, onClick, submit, target