I have the same code one multiple pages and would like to clean that up. It
is for submitting a form via Ajax. The only thing different in the form
would be the form id , where its going and the validation rules. But all of
that is taken care of thru standard naming convections thru-out the site.
I have on the page with the form:
$(document).ready( function() {
$('#newEntry').bind('submit', function(testForm));
});
In the external js:
function testForm()
{
var form_id = this.attr('id');
var form_url = $(this).attr('action');
var page_target = form_url.substr(1).replace( new RegExp( "/" ,"g"),
"_" );
var hide_form = page_target + '_form';
alert(form_id);
alert(form_url);
alert(page_target);
alert(hide_form);
return false;
}
Can someone see where I am going wrong here so far?
No alerts or anthing.
Thanks
Dave