HighDots Forums  

Space in object name

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Space in object name in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Oak Hall
 
Posts: n/a

Default Space in object name - 08-25-2005 , 04:10 PM






I have a button that puts a value into a field. It work when there is no
space in the field name. But doesn;t work if there is. How can I make it
work.

<input type="text" name="with space" value=""> <input type="button"
name="defualt" value="NewValue" onclick="with space.value='NewValue';">

Thanks
Oak



Reply With Quote
  #2  
Old   
Kimmo Laine
 
Posts: n/a

Default Re: Space in object name - 08-25-2005 , 10:25 PM






"Oak Hall" <oak (AT) scenicmls (DOT) com> kirjoitti
viestissä:jtqPe.709$Xo3.124 (AT) news01 (DOT) roc.ny...
Quote:
I have a button that puts a value into a field. It work when there is no
space in the field name. But doesn;t work if there is. How can I make it
work.

input type="text" name="with space" value=""> <input type="button"
name="defualt" value="NewValue" onclick="with space.value='NewValue';"


That's easy, stop using spaces in object names. That's just the first
problem you've encountered, and if you continue using spaces, you will find
so many other "space in name" related problems.

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <eternal.erectionN0 (AT) 5P4Mgmail (DOT) com>




Reply With Quote
  #3  
Old   
Oak Hall
 
Posts: n/a

Default Re: Space in object name - 08-26-2005 , 05:53 AM



replace with %20? Thanks Oak

"Kimmo Laine" <eternal.erectionN0.5P (AT) Mgmail (DOT) com> wrote

Quote:
"Oak Hall" <oak (AT) scenicmls (DOT) com> kirjoitti
viestissä:jtqPe.709$Xo3.124 (AT) news01 (DOT) roc.ny...
I have a button that puts a value into a field. It work when there is no
space in the field name. But doesn;t work if there is. How can I make it
work.

input type="text" name="with space" value=""> <input type="button"
name="defualt" value="NewValue" onclick="with space.value='NewValue';"



That's easy, stop using spaces in object names. That's just the first
problem you've encountered, and if you continue using spaces, you will
find so many other "space in name" related problems.

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/
Kimmo Laine <eternal.erectionN0 (AT) 5P4Mgmail (DOT) com




Reply With Quote
  #4  
Old   
Kimmo Laine
 
Posts: n/a

Default Re: Space in object name - 08-26-2005 , 06:40 AM



"Oak Hall" <oak (AT) scenicmls (DOT) com> wrote

Quote:
replace with %20? Thanks Oak


Oh, hooray, you found the answer. Now you have something that accidently
works in internet Explorer, but doesn't work in Opera or Firefox. %20 is
just as bad as a space, since % is an operator (modulo) and therefor
reserved.

I'm sure you have a reason for what you are doing and you must be thinking
spaces schmaces, what's the difference. You have the right to believe so and
I don't object that. Still, you might concider what I told you. You might
concider why the rest of the world coders _don't_ use space in variable and
object names*. There's a reason for that.

*) okay, now someone's gonna tell me that there's some frikkin badass
programming language that does allow spaces in names, but that's not the
point here.

--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com




Reply With Quote
  #5  
Old   
Jasen Betts
 
Posts: n/a

Default Re: Space in object name - 10-15-2005 , 07:37 AM



On 2005-08-25, Oak Hall <oak (AT) scenicmls (DOT) com> wrote:
Quote:
I have a button that puts a value into a field. It work when there is no
space in the field name. But doesn;t work if there is. How can I make it
work.

input type="text" name="with space" value=""> <input type="button"
name="defualt" value="NewValue" onclick="with space.value='NewValue';"
document.getElementById

look it up. use it.

--

Bye.
Jasen


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.