Form Validation with Drupal Twist
I will try to explain this as simply as possible.
We use a 3rd party email marketing tool. We use it to create website forms to collect information from perspective clients. This for relays its data back to the 3rd party marketing tool online. We pas the forms into our drupal pages through the wysiwyg. We then set up jquery form validation. The 3rd party company recently switched there code. Now I can not get validation to work on the new code.
Here is the old form code that worked with the form validator. Notice Rules = field_Data[27618] -
- <script>
$(document).ready(function(){
$("#frmRegister").validate({
rules: {
"field_data[27618]": { /* first name */
required: true,
minlength: 2
},
"field_data[29798]": { /* last name */
required: true,
minlength: 2
},
"field_data[64981]": { /* request information */
required: true
},
email: {
required: true,
email: true,
}
},
messages: {
"field_data[27618]": "<br>Enter your first name",
"field_data[29798]": "<br>Enter your last name",
"field_data[64981]": "<br>Select the person for whom you are requesting information",
email: {
required: "<br>Please enter a valid email address",
minlength: "<br>Please enter a valid email address"
}
}
});
});
</script>
Here is the new code. Notice that the field_data went away and now there is a number 3723[27618]
- <script>
$(document).ready(function(){
$("#frmRegister").validate({
rules: {
"3723[27618]": { /* first name */
required: true,
minlength: 2
},
"3724[29798]": { /* last name */
required: true,
minlength: 2
},
"3728[64981]": { /* request information */
required: true
},
email: {
required: true,
email: true,
}
},
messages: {
"3723[27618]": "<br>Enter your first name",
"3724[29798]": "<br>Enter your last name",
"3728[64981]": "<br>Select the person for whom you are requesting information",
email: {
required: "<br>Please enter a valid email address",
minlength: "<br>Please enter a valid email address"
}
}
});
});
</script>
However, the form validation will not work now. I am thinking it is just the number instead of the filed_data that is the issue. I am not enough of a developer to figure out the new way to write it so it works.
Would anyone have some suggestions that I can try or something that I can look up and research?
I can post the full form for both but didn't think it was needed.
Thank you very much
Tim