Hi Everyone, Below is my javascript for the form I have. Some of the functions showed are not being used because they were taken out of the form due to not being needed. However, I do need to have the "Reset" button function right and don't know the proper function for it. Can someone please help me out by showing me where it goes in my script. I am javascript/jQuery illiterate so please be specific. Thank you so much in advance.
<script type="text/javascript">
$(document).ready(function() {
$('#register').validate({
rules: {//rulls will go here
first_name: 'required',
last_name: 'required',
email: {required:true, email:true},
edd: {required:true, date:true},
},//end of rules
//start of messages
messages: {
email: {
required: "Please enter your primary email address.",
email: "The email you provided is not in the proper format."
}
}//end of messages
});
$(document).ready(function() {
//focus to the first name field.
$('#first_name').focus();
$('input[type=text]').focus(function() {
$(this).addClass('inputFocus');
});
$('input[type=text]').blur(function() {
$(this).removeClass('inputFocus');
}); // to be the end of focus function
//now I will attemp to hide the spouse's info text box if user is single.
Hi Everyone, I have a basic jQuery accordion on a website, but I would like to know how to have all the fields collapsed when someone enters the page instead of the first one being open. Can anyone show me the right function or script to do that please. I am very unfamiliar with jQuery language so could you please show me how it would go in my script, which is below. Thank you very much.
<script type="text/javascript">
$(document).ready(function() {
// Accordion
$("#accordion").accordion({ header: "h3" });
//tabs
$('#tabs').tabs({
fx: {opacity:'toggle', duration: 'fast'}
});
}); //end of document ready
Here is the basic html used for the script:
<div id="accordion">
<h3><strong><a href="#">Nitrous sedation for any procedure the patient is nervous about. </a></strong></h3>
<div>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci. </div>