I have created a registration form page using the webform module. The registration form page contains personal info and billing info groups with fisrtname, lastname, email, age fields and a check box saying "billing info same as personal info". Where should I write a jQuery script to put all the personal info in billing info fields when the check box is checked?
- I have created a js
folder/check_box.js
file in the bartik theme folder which i am using - then made changes in
bartik.info
file asscripts[]=js/check_box.js
- then added
drupal_add_js
intemplate.php
- cleared all caches
but still I cannot execute my script which I have written for check box or the fields.
$("#checkbox_id").change(function() {
if(this.checked){
alert("checked");
});
})(jQuery);
This is my code to check whether its working or not. Is it correct? If not please help me with the code.