sphinx Posted November 28, 2011 Share Posted November 28, 2011 Hello, The code below works fine on IE 8 but seems to be malfunctioning on IE 8, I was wondering if any noticable errors are noticed: <script type="text/javascript"> $(document).ready(function() { $("#form1").validate({ rules: { subject: "required", email: { required: true, email: true }, from: { required: true, email: true }, captcha: { minlength: 3, maxlength: 3, required: true, }, amount: { maxlength: 2, number: true, required: true, }, message: { required: true, } }, }); }); </script> <form class="appnitro" name="validation" method="post" id="form1"> <h2>Perform an Email Test</h2> <li id="li_1" > <label class="description" id="email" for="email">Email you want to test: </label> <div> <input id="email" value="yu" autocomplete="off" name="email" class="element text medium" type="text" maxlength="255" value=""/> </div><p class="guidelines" id="guide_1"><small>Enter the email address you wish to perform the email test on</small></p> </li> <li id="li_2" > <label class="description" for="element_2">Subject of the email: </label> <div> <input id="subject" value="y" value="y" autocomplete="off" name="subject" class="element text large" type="text" maxlength="255" value=""/> </div><p class="guidelines" id="guide_2"><small>Enter the email subject that will appear</small></p> </li> <li id="li_3" > <label class="description" for="element_3">'Reply' email: </label> <div> <input id="from" value="y" value="y" autocomplete="off" name="from" class="element text medium" type="text" maxlength="255" value=""/> </div><p class="guidelines" id="guide_3"><small>Enter the email address that it will addressed from</small></p> </li> <li id="li_4" > <label class="description" for="element_4">How many emails do you want to send? </label> <div> <input id="amount" value="y" value="y" name="amount" autocomplete="off" class="element text medium" type="text" value=""/> </div><p class="guidelines" id="guide_4"><small>Enter the amount of emails you want to send, the maximum is 99 for spam protection</small></p> </li> <li id="li_5" > <label class="description" for="element_6">Message in the email: </label> <div> <textarea id="message" name="message" autocomplete="off" class="element textarea medium">y</textarea> </div><p class="guidelines" id="guide_5"><small>Enter the content of the email</small></p> </li> <li id="li_10" > <label class="description" for="email">Captcha: </label> <div> <input id="captcha" name="captcha" autocomplete="off" class="element text medium" type="text" value=""/> <img src="captcha.php" onClick="return reloadImg('img');" id="img" alt="captcha image"> <br /><br /><div id="captchatextsmall" >Enter the 3 black characters shown (click <a href="#" onClick="return reloadImg('img');">here</a> to change)</div><div id="captchatext" >That code was incorrect, please try again.</div> </div> <p class="guidelines" id="guide_10"><small>Enter the 3 black characters in the captcha shown</small></p> </li> <input type="hidden" name="form_id" value="294670" /> <li class="buttons"> <input type="hidden" name="form_id" value="294670" /> <button id="saveForm" class="positive" id="submit" type="submit" name="save" value="Process"> <img src="http://www.mybestworks.com/works/css_button_trick/images/apply2.png" alt=""/>Submit </button> </li> <li id="captchatext" ></li> <li id="li_3" ><div id="p50">Please enter the above details above.</div></li> </ul> </form> Quote Link to comment https://forums.phpfreaks.com/topic/251943-j-query-not-functioning-properly-on-ie-8/ Share on other sites More sharing options...
trq Posted November 28, 2011 Share Posted November 28, 2011 You have extra commas after some of your properties. required: true, For example. Quote Link to comment https://forums.phpfreaks.com/topic/251943-j-query-not-functioning-properly-on-ie-8/#findComment-1291771 Share on other sites More sharing options...
sphinx Posted November 28, 2011 Author Share Posted November 28, 2011 If I remove the comma, the validation stops working all together. Quote Link to comment https://forums.phpfreaks.com/topic/251943-j-query-not-functioning-properly-on-ie-8/#findComment-1291888 Share on other sites More sharing options...
Adam Posted November 28, 2011 Share Posted November 28, 2011 Which one did you remove? Only the last comma in each object should be removed, otherwise you will break the syntax. I'm quite surprised browsers (with obviously the exception of IE8) are so tolerant of trailing commas after the last property. Quote Link to comment https://forums.phpfreaks.com/topic/251943-j-query-not-functioning-properly-on-ie-8/#findComment-1291890 Share on other sites More sharing options...
sphinx Posted November 28, 2011 Author Share Posted November 28, 2011 Thanks adam, Solved! Do you know how I would go about disallowing the number '0' at the beginning of a field between 1-99 using jquery? Thanks edit: amount: { maxlength: 2, number: true, required: true }, Also, How can I give my error's custom messages instead of 'this field is required' Quote Link to comment https://forums.phpfreaks.com/topic/251943-j-query-not-functioning-properly-on-ie-8/#findComment-1291902 Share on other sites More sharing options...
Adam Posted November 28, 2011 Share Posted November 28, 2011 Which plug-in are you using? Quote Link to comment https://forums.phpfreaks.com/topic/251943-j-query-not-functioning-properly-on-ie-8/#findComment-1292019 Share on other sites More sharing options...
sphinx Posted November 29, 2011 Author Share Posted November 29, 2011 <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.js"></script> Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/251943-j-query-not-functioning-properly-on-ie-8/#findComment-1292101 Share on other sites More sharing options...
sphinx Posted November 29, 2011 Author Share Posted November 29, 2011 Sorry, just tried on ie 8 again and I can click submit instantly without jquery blocking it. Code: <!--//Field checkers - JQUERY //--> <script type="text/javascript"> $(document).ready(function() { $("#form1").validate({ rules: { subject: "required", email: { required: true, email: true }, from: { required: true, email: true }, captcha: { minlength: 3, maxlength: 3, required: true }, amount: { maxlength: 2, number: true, required: true }, message: { required: true } }, }); }); </script> Thanks Quote Link to comment https://forums.phpfreaks.com/topic/251943-j-query-not-functioning-properly-on-ie-8/#findComment-1292113 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.