This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Handling dot in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Handling dot in javascript" Watch "Handling dot in javascript" New topic

Handling dot in javascript

Sahil Sharma
Ranch Hand

Joined: Aug 27, 2003
Posts: 152

in my html the names of my textboxes are like this "attributes(first_name).value"

Now i need to peform a validation on this textbox, let's say mandatory check.

But i don't know how to escape the dot "." that is present in the name of the textbox "attributes(first_name).value"

when i write this in my javascript

document.forms[0].attributes(first_name).value.value then i doesn't work.

Please help!

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
I will not ask why in the world they are named like this

You need to use the element array

document.forms[0].elements["elementName"].value = "asdf";

I agree. Here's the link:
subject: Handling dot in javascript
Similar Threads
How to populate a value in text box
value after posting
Textbox value change event
problem in getting values using EL