OnClick help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Jay87
Forum Commoner
Posts: 61
Joined: Thu Jan 07, 2010 5:22 am

OnClick help

Post 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?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: OnClick help

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply