HighDots Forums  

form element values

alt.html.dhtml alt.html.dhtml


Discuss form element values in the alt.html.dhtml forum.



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

Default form element values - 02-20-2004 , 02:52 AM






Hi,

I am having problems reflecting the form element values .

I have a page with a form with a text box. I am trying to change the
value of this text box to something depending on user action. However
i am not able to do so. Following is the HTML code i have written

**********************
<FORM NAME="hwForm" METHOD="POST" ACTION="hwinventory.asp">
<INPUT TYPE="text" ID="assetIDList" VALUE="init"></INPUT><BR>
</FORM>


function changeValue()
{
self.document.getElementById("assetIDList").Value= "test"
}
*********************

after calling changeValue() the text in the textbox does not get
reflected.

is there another way to achieve this

tia
hursh

Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: form element values - 02-20-2004 , 05:21 AM






aguyfromdelhi (AT) yahoo (DOT) com (Hursh) wrote:

Quote:
self.document.getElementById("assetIDList").Value= "test"
You need to use "value" instead of "Value".

Write 100 times "JavaScript is case sensitive".

(I didn't, and now my book on CSS has two occurrences of the spelling
"getElementbyID", and I'm ashamed. Luckily I tested the code samples,
and they have the correct spelling, so maybe nobody will notice.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html




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.