views:

218

answers:

2

in my form i have this code

<form action="mail.php" class="contactForm" name="cform" method="post">

Problem is when i validate it tells me "name" is not allowed on xhtml strict. is there a way i can use soem thing else for this.

thanks

A: 

Use ID.

<form action="mail.php" class="contactForm" id="cform" method="post">
Jesse Millikan
+2  A: 

You should be using id as a unique identifier instead of name.

Is there a particular reason that you need to set the name though? You can just remove the name declaration unless there's a reason for it.

Chad Birch
the form doesn't work unless i use name, id will not work tooscript is using this in few line to process form to mail.php---------------------------------if ((document.cform.name.value == "")
anique
Reference it in JS by using `document.getElementById('myID').value` etc. As for server-side checking of multiple forms, you can make a difference between the forms by giving the `<input type="submit" />` a different name in each form, and checking if it's set (`isset($_POST['form1_submit'])`), for example in PHP
henasraf