Page 1 of 1

OnClick help

Posted: Mon Mar 08, 2010 9:03 am
by Jay87
I want to add a page re-direct to 'calllist.php' on the following onclick:

Code: Select all

onclick="window.onbeforeunload=null;if(document.forms[0].desc.value=='' || document.forms[0].user.value==''){alert('Missing valid fields (Subject, Details or User)');return false;} else {document.forms[0].submit();return false;}"
Any ideas how?

Re: OnClick help

Posted: Mon Mar 08, 2010 1:43 pm
by pickle
Javascript is Client-Side. Moving post.

Also, with that much Javascript, I'd suggest putting it in a function and calling that function onClick - just to make it easier to read.