G'day,

I was wondering if anyone knows how to get the following to work:

--snip from head--
<script language="JavaScript">
//-->
function validateForm(theForm) {
   if ( theForm.input[name].value == "" ) {
   alert("You must type a value for NAME.");
   theForm.input[name].focus();
   return false;
   }

}
<!--
</script>

--/snip--
--snip from body---

<form name="form" method="post" action="whatever" onSubmit="return 
validateForm(this);">
<input type="text" name="input[name]">
<input type="text" name="input[address]">
<input type="submit" value="submit">
</form>

--/snip--

Now the above doesn't work as I think javascript does not understand 
arrays? or I don't understand how javascript deals with arrays??

Any help/suggestions would be great, sorry if this post is a little off 
topic in the way of javascript but I would not be having this trouble if 
I weren't passing the form data to php via an array :-)

Regards,

Joseph.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to