473,378 Members | 1,412 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,378 software developers and data experts.

slash in a form item name

Hello,

I have to change the value of a form item wich contains slashes in its name
(ie: <input name="hello/how/are/you" ....>)
I know it's crazy but the form is dynamically generated by a 3rd party tool,
so I don't have any control on it.

With this piece of code I can see the item names :

function tst() {
for (i=0; i<document.tst.elements.length;i++) {
alert(document.tst.elements[i].name);
}
}

But how can I change its value ?

Thanks in advance,
Pierre-Yves.
Jul 23 '05 #1
2 1461
Pierre-Yves wrote:
I have to change the value of a form item wich contains slashes
in its name (ie: <input name="hello/how/are/you" ....>)
I know it's crazy but the form is dynamically generated by a
3rd party tool, so I don't have any control on it.

With this piece of code I can see the item names :

function tst() {
for (i=0; i<document.tst.elements.length;i++) {
alert(document.tst.elements[i].name);
}
}

But how can I change its value ?


See the group's FAQ, particularly quick answers 4.25 and 4.39 (and
linked resources).

<URL: http://jibbering.com/faq/ >

The result will resemble:-

document.forms['tst].elements['hello/how/are/you'].value = x;

(but it is best to use the FAQ references and understand why)

Richard.
Jul 23 '05 #2
Nice FAQ!
it solved my problem, thanks !

"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:ck*******************@news.demon.co.uk...
Pierre-Yves wrote:
I have to change the value of a form item wich contains slashes
in its name (ie: <input name="hello/how/are/you" ....>)
I know it's crazy but the form is dynamically generated by a
3rd party tool, so I don't have any control on it.

With this piece of code I can see the item names :

function tst() {
for (i=0; i<document.tst.elements.length;i++) {
alert(document.tst.elements[i].name);
}
}

But how can I change its value ?


See the group's FAQ, particularly quick answers 4.25 and 4.39 (and
linked resources).

<URL: http://jibbering.com/faq/ >

The result will resemble:-

document.forms['tst].elements['hello/how/are/you'].value = x;

(but it is best to use the FAQ references and understand why)

Richard.

Jul 23 '05 #3

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

Similar topics

25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
15
by: fredo | last post by:
I have in my page: <base href="http://www.simple-nude.com/"> and later want to direct a visitor to, say, http://www.simple-nude.com/today/hippie-goddess/15b.jpg It seems that the link...
2
by: Tom | last post by:
I've beat my head every way I can think of against this wall. Maybe someone here just knows the answer. I'm testing an upload class on my laptop WAMP server. When I run the test script,...
1
by: peck2000 | last post by:
Related to my earleir post ... this is the same project to re-purpose the Classifieds application in BEGINNING ASP 3.0 (Wrox) to a comicbook database ... This is a brainteaser that should have...
23
by: dkirkdrei | last post by:
I am having a bit of trouble trying to double up on slashes in a file path. What I am trying to do is very similar to the code below: <? $var =...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
11
by: Twayne | last post by:
Hi, Newbie to PHP here, no C or other relevant background, so pretty niave w/r to the nuances etc. but I think this is pretty basic. XP Pro, SP2+, PHP 4.4.7, XAMPP Local Apache Server...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.