View Single Post
Old 03-13-2006, 12:13 PM   #6 (permalink)
Radnor
Contributing Member
 
Join Date: 07-30-05
Posts: 247
iTrader: 0 / 0%
Latest Blog:
None

Radnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really niceRadnor is just really nice
I think your code is looking for ALL input fields without considering which form it is from.

Code:
reqFs = document.getElementsByTagName("INPUT");
need a way to tell it which form to read and ignore the other.


Try this.... Reads the form name and adjust the message. (DID NOT TEST IT)

Code:
function dataok(formName) { var strFields = ""; var strData; strData = document.forms[formName].name.value; if (strData.length == 0) { strFields += " NAME"; } strData = document.forms[formName].email.value; if (strData.length == 0) { if (formName == 'contact" { strFields += " EMAIL"; } else { strFields += " CALL BACK NUMBER"; } } strData = document.forms[formName].message.value; if (strData.length == 0) { strFields += " MESSAGE"; } if (strFields.length > 0) { alert("The following field(s) were blank" + strFields); } }
Radnor is offline   Reply With Quote