[thelist] vbscript: form values disappearing when I don't use 'name'

Matt Warden mwarden at gmail.com
Tue Apr 18 12:51:19 CDT 2006


On 4/18/06, Canfield, Joel <JCanfield at pacadvantage.org> wrote:
> I'm trying to get away from using both 'name' and 'id' for form fields.
> but without 'name', the field values are blank/missing/something like
> that.
>
> with these fields in the form
>
>   First <input type="text" id="FirstName" size="24" /><br />
>   Last <input type="text" id="LastName" size="24" /><br />
>
> this in the response page writes only the line breaks
>
>   With Response
>         .Write(strFirstName & "<br />")
>         .Write(strLastName & "<br />")
>   End With
>
> but if I add 'name' or use *only* name instead of 'id', all is well.

Name is a required attribute. You must have a name attribute in form
elements, with th exception of submit and reset buttons.

You may have been confused by the fact that the name attribute on
certain other elements, like form and img, is deprecated. Many sites
mistakenly say "use name instead of id in xhtml." This is flat out
wrong.

--
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list