473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Name of Form Element begin with number

I have problem in retrieve a value of a form element that have name
begin with a number. For example, for this HTML code
<input type="text" name="0000ABC12345CD6789" id="0000ABC12345CD6789">
I got Javascript error at document.form.0000ABC12345CD6789.value

Thanks.
Jul 20 '05 #1
2 1689
In article <91************************@posting.google.com>,
vi****@juno.com enlightened us with...
I have problem in retrieve a value of a form element that have name
begin with a number. For example, for this HTML code
<input type="text" name="0000ABC12345CD6789" id="0000ABC12345CD6789">
I got Javascript error at document.form.0000ABC12345CD6789.value

Thanks.


Don't use the shortcut syntax if your elements begin with numbers or
special characters. It's not very cross-browser, anyway.

And I sure hope you didn't name your form "form"...

Sub your formname here.
document.forms["formname"].elements["0000ABC12345CD6789"].value

--
--
~kaeli~
A man needs a mistress... just to break the monogamy.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2
Hi,

Viet wrote:
I have problem in retrieve a value of a form element that have name
begin with a number. For example, for this HTML code
<input type="text" name="0000ABC12345CD6789" id="0000ABC12345CD6789">
I got Javascript error at document.form.0000ABC12345CD6789.value

Thanks.


This is not legal HTML.

From the HTML 4.01 specs:
<quote>
# ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".").
</quote>

See the specs at
<URL: http://www.w3.org/TR/html401/types.html#type-cdata>

Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jochen Daum | last post by:
Hi ! If I have an input field <form ... method="post"> <input type="text" name="abc def"> </form>
2
by: Mark | last post by:
Hi - I have a dynamically created table, which has a number of forms - each named consecutively as 'adduserX' where X is a number generated from ASP. Within each form, I need to have a button...
12
by: CJ | last post by:
Why won't this work? I am passing the name of the form (I have two that use this validation script) but I keep getting an error. Error reads: "document.which_form.name is null or not an object" ...
4
by: Martin Lucas-Smith | last post by:
I am wanting to know whether are XHTML1-valid characters for use within an id attribute and/or a name attribute. ...
6
by: Neil Cherry | last post by:
I'm working on a JavaScript program and I'm running into name=blah and id=blah. Sometimes it's one or the other and other times it both. Does anyone have a good reference that can help me figure...
24
by: Chameleon | last post by:
This code does not working in Mozilla. Works fine in IE. -------------- <input type=text value=100 name=textbox> <script> alert(textbox); </script> -------------- This perhaps, because of...
6
by: btknorr | last post by:
The following html and javascript combination fails to execute in Internet Explorer...does anyone know why? If you change the input's attribute "name" to anything other than "item" it works just...
3
by: jparulan | last post by:
Hi All, I'm using SOAP3.0. I was able to successfully call a WSDL file and get a value properly. But when the WSDL changed to have a MULTIPLE <element name> it was failing. This code works...
6
by: Inge Jones | last post by:
I have a form that dynamically generates Submit buttons. I want all the buttons to display the same text "More info" while their names are dynamically generated numeric names (they point to database...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.