elliottmina
Programmer
I am trying to hijack an existing form and use it for a different purpose. Unfortunately I cannot just change the form itself.
When the form is submitted throuh clicking the submit button, or hitting the enter key on an input field, a function is called to validate the form and then allow/disallow it to submit.
After the form and javascript function, I redeclare the validation function as such:
function ShowAlert()
{
alert('hijacking search');
//set a cookie
window.location = '/sandbox/foo/bar.aspx';
return false;
}
I want to stop the form from submitting, and instead have it go to /sandbox/foo/bar.aspx. It works fine in IE, but Firefox always allows it to follow the form's action.
TIA!
When the form is submitted throuh clicking the submit button, or hitting the enter key on an input field, a function is called to validate the form and then allow/disallow it to submit.
After the form and javascript function, I redeclare the validation function as such:
function ShowAlert()
{
alert('hijacking search');
//set a cookie
window.location = '/sandbox/foo/bar.aspx';
return false;
}
I want to stop the form from submitting, and instead have it go to /sandbox/foo/bar.aspx. It works fine in IE, but Firefox always allows it to follow the form's action.
TIA!