Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dealing with dash in form element name 2

Status
Not open for further replies.

leahyj

MIS
May 5, 2004
107
US
Hi,

I need to populate a form input element using javascript and the form name has a dash in it.

I know that the dash is an illegal character.

Code:
document.forms.paynow_frm.cde-PropIntID.value = strintids;

I don't have any control in changing the name of the form element to remove the dash.

Thanks in advance.
 
any chance you can use an ID?

this may work though...
Code:
var e = document.getElementByName("cde-PropIntID");
e.value =  strintids;

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Hey cLFlaVA:

That worked!

Thanks.

Also 1DMF:

I didn't try your suggestion, but thanks.

It looks like it would work.

Take care
 
1DMF, it's getElement[red]s[/red]ByName, and it returns an array of elements with the same name.

Lee
 
Thanks Lee for picking up my type'o

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Bingo :)

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top