Self Improvement Articles Directory - Find jobs - Debt Consolidation - Premium wordpress themes - Web Hosting

PDA

View Full Version : syntax assistance


motheherder
Feb 20th 2007, 5:32 am
when accessing the values from a form called users, the following line provides a solution

form.whatever.value

where 'whatever' is the name of the input.

How do I include an input name such as 'U.K. Fred' as it seems that the use of spaces and '.'s are not welcomed

thank you

mo

nico_swd
Feb 20th 2007, 5:40 am
First off, why on earth would you call a field like that? The "name" attribute is not visible to the user, so why this name?

If you still want to keep it, you can do for example this:

Give the element a unique ID and use


document.getElementById('your-id').value;


And you can give this a try as well if you just want to leave the name.

document.getElementByName('U.K. Fred').value;

motheherder
Feb 20th 2007, 8:00 am
nico thank you for your response, and a very good question too (lol), I might mail it to the person responsible for the database content. My mission is a little convoluted as i am making an ado connection returning a record count value to which I would like to assign a js function. I have adjusted the results to appear in the id element rather than name and this seems to have solved the problem. thank you very much for your help. mo