What would cause Spry to allow my Form to be submitted when the "Required" fields are left blank? Here is what is happening:
- I leave the fields blank and click my "Submit" button
- I briefly see the fields go Red with message "A Value is required"
- Then the Form submits anyway (tables update/no errors)
Here is the full code listing: http://cerberus.clearwave.com/jerry/spry_example_ctt1b.pdf
Notice:
- I'm using jquery mobile on my page
- I'm inserting data into two tables at one time (Lines 8, 196, 203)
- I have Spry text Validation on only a few fields for now (ex. Line 483)
Here is a design view of my page:
The problem is with
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
I have searched for a possible solution, but not found one as yet.
Gramps
Gramps, I have tried a bunch of various ideas & solutions but none work..
- If i comment out the jquery line above, the Submit button seems to work fine..but page has no jqm markup?
- Here are some code ideas from another blog, but it will not submit my form1?
I added this code to the head:
------------------------------------------------
<!--- Create the code for the Submit button and force Spry Validation to work * Not Working!* --->
<script language="javascript" type="text/javascript">
function validateonsubmit(){
var myForm=document.getElementById("form1");
var SS= Spry.Widget.Form.validate(myForm);
if(SS==true){
myForm.submit();
}
}
</script>
Then at the bottom of the page:
---------------------------------------
<a href="#" onclick="javascript:validateonsubmit();">Validate on Submit</a>
When I click the "Validate on Submit" text link, the Spry fields go Red. Good! Then I fill them in and they go Green. Good!
But the Form1 will not submit & the data is never saved to the backend?
Any help would be appreciated..
North America
Europe, Middle East and Africa
Asia Pacific