View Full Version : Problem with Id and name as form attributes

10-11-2008, 06:06 PM

I have a form like this:

<form method="post" action="/account/register" id="registrationform" name="registration">

I have two pieces of Java Script. One needs the id tag and the other needs the name. The one that needs name, needs it for something like:


If I take out the name it complains...

The problem is that if I am to follow strict XHTML guidelines I should be using either name or id but not both... any ideas?

10-12-2008, 02:19 AM
Assuming 'countryCode' is a text element, you can access its value by:


in place of the 'document.registration.countryCode.value'

<input type="text" id='countryCode' name='countryCode' value='USA'>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum