jozz
unread,Mar 19, 2011, 5:27:09 AM3/19/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ModalBox
Hi all, thaks for your help in ModalBox groups.
I have a modalbox window that contains a php form with post method,
but before to do submit i have to validate the form with javascript
validation.
I think I found the way do PHP form submit + javascript validation on
ModalBox Windows. I've tested on FF & IE
1. launch modal window from parent php page
<a href="childwindow.php" title="Title"
onclick="Modalbox.show(this.href, {title: this.title}); return
false;">Launch ModalBox</a>
2. on child window, only use onclick event on the buttom that is going
to submit, important type="button".
I use a javascript function to validate the form (JSValidateFunction)
that return true or false.
So all is going to do is to put a condicional in onclick event to
validate or send data thru another ModalBox, that in my case is the
same child window.
<form id="formname" name= "formname" method="post"
action="childwindow.php" onsubmit="return false;" ENCTYPE="multipart/
form-data" >
...
<input name="OK" type="button" value="OK"
onClick="javascript:if(JSValidateFunction==true)
{Modalbox.show('childwindow.php', {title: 'Result', method: 'post',
params: Form.serialize('formname'),overlayClose: true }); return
false;}else{return false;}" >