Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Updating a text box
Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Blade




PostPosted: Thu Nov 20, 2003 2:36 pm   Post subject: Updating a text box

with javascript how can i make it so that you use a <select> list, then when you select one of the lists, a text box will update with a number?
Sponsor
Sponsor
Sponsor
sponsor
Amailer




PostPosted: Thu Nov 20, 2003 5:58 pm   Post subject: (No subject)

idk, but i think you use the onChange() function.
http://forums.devshed.com/archive/1/2003/10/2/90739

i think idk
Blade




PostPosted: Fri Nov 21, 2003 2:56 pm   Post subject: (No subject)

hmm... how about this

you have a select box, that has a number of options, beside it there is an empty text box. depending on what you select for the drop-down-menu, a number is placed in the text box.. this must be done without refreashing the page.
Amailer




PostPosted: Fri Nov 21, 2003 8:08 pm   Post subject: (No subject)

asdadsa
this?
code:

<SCRIPT LANGUAGE="JavaScript">
<!--
function onChange(object) {
    var Current = object.selectName.selectedIndex;
    object.currentText.value = object.selectName.options[Current].text;
}

//-->
</SCRIPT>

<FORM NAME="formName3" onSubmit="return false;">
<SELECT NAME="selectName" onChange="onChange(this.form)">
<OPTION VALUE="Option 0" SELECTED>Entry 0
<OPTION VALUE="Option 1">Entry 1
<OPTION VALUE="Option 2">Entry 2
<OPTION VALUE="Option 3">Entry 3
<OPTION VALUE="Option 4">Entry 4
<OPTION VALUE="Option 5">Entry 5
</SELECT>
<P>
Text: <INPUT NAME="currentText" TYPE="TEXT" VALUE="">
<P>
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!--
onChange(document.formName2);
//-->
</SCRIPT>
Blade




PostPosted: Sat Nov 22, 2003 2:27 pm   Post subject: (No subject)

yeah, thats pretty much what i was looking for. thanks
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: