Jump to content

Recommended Posts

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>	

 

 

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.

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'

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.