I have a simple form with the correct name and id attributes. I am using the following script in the <head> of the document so that the form will not submit until a required field has something in it. It works perfectly until I try it in MODX. I'm using Revolution 2.1.5
$('#cares_form').on('submit', function () {
if($('#cares_org').val() == ""){ // if empty
$('#please_check_required').html("Please check that all of the required fields marked with a * above are properly filled out");
return false;
} else {
return true;
}
});
[ed. note: bluemonkey3000 last edited this post 14 years, 5 months ago.]
Is this a live page we can see?
I am counting at least four instances of id="jakks_cares_org" in the source, two DIVs and two INPUTs, jQuery is returning one of the DIVs which has no value.
rossco's first two suggestions still stand.
I'd also HIGHLY recommend that sucker through webpagetest.org
Thanks all. jmaddington, you nailed it. Somehow, I was placing the form in the content of the page in such a way that my css was having it displayed in three instances.