I am trying to control a form submit confirmation using a Fancybox confirmation message.
How can I add an event to the form submit using jQuery fancybox?
my form source is bellow:
<form name="oactivite" action="url" method="POST" onsubmit="return confirmTask(' do you confirm task : '+document.forms['oactivite'].elements['task_id'].options[this.document.forms['oactivite'].elements['task_id'].selectedIndex].text+'?');">
<select name="task_id" id="task_id">
<option value="1">Pause</option>
<option value="2">Digit</option>
<option value="3">editing</option>
</select>
<div name="emp_id" value="20" style="display:none" />
<input type="submit" value="validate task"/>
</form>
how can i show a fancybox confirm message when i call confirmTask ?
You should show us some of your code, but hopefully this helps. Fancy box has a method to open the lightbox, you can call that on the form submit like so:
You can then put another element (for example, your confirm button) which then calls the form submit:
See the tips and tricks section on fancy box for reference