Trying to do an IF statement for empty fields in a form, but it is not working
I am working on a validation function that will check that the data entered into a form is valid. At the moment, I am just doing tests to make sure that data is entered into a form. However, with this coding that I have so far, it does not seem to work properly. It is probably something simple (i.e. a missing bracket or something), but I can't see what it is.
Here it is:
Thanks in advance for any help given!
if(((senderemailaddress=null||senderemailaddress="")&& (sendername=null||sendername="") && (sendercomments=null||sendercomments="")))
alert("You have not entered any values for the Name, E-Mail Address or Comments fields. Enter in suitable values");
EDIT: I've got it now, I was not using "==", silly me
Last edited by APD1993; 03-07-2012 at 09:52 AM.
Reason: Fixed problem
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)