Little javascript help

Beattie

Golden Member
Sep 6, 2001
1,774
0
0
I am not so good with javascript, and I need to do this form where like, someone selects something from a drop down combobox or whatever, and it automatically updates a text box with the selection. Can someone help me with this, I dont think it's that complicated.
 

shutterFly

Member
Nov 5, 2003
57
0
0
Something like this should work for IE and Netscape. Not sure about the other browsers though. You can modify accordingly:

<script language="javascript">
<!--

function f_AssignValue(strValue){
if(document.all){ // For IE.
document.all["tbTarget"].value = strValue;
}
else{ // For Netscape
document.getElementById("tbTarget").value = strValue;
}
}

-->
</script>

<input type="text" id="tbTarget">

<select onchange="f_AssignValue(this.value);">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
 

Beattie

Golden Member
Sep 6, 2001
1,774
0
0
awesome.

Is there any way that I could like... connect to an access database with javascript and run a few queries?

Basically my ultimate goal is to like have one drop down and then when someone selects something on that, it connects to a database and runs a query based on what they choose. Then it populates another drop down with the results of the query.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Um, no, like you sorta have to do that with a server side language or whatever.
 

AFB

Lifer
Jan 10, 2004
10,718
3
0
Originally posted by: Beattie
awesome.

Is there any way that I could like... connect to an access database with javascript and run a few queries?

Basically my ultimate goal is to like have one drop down and then when someone selects something on that, it connects to a database and runs a query based on what they choose. Then it populates another drop down with the results of the query.

I think youi would have to have the page reload and like kamper said, use a server side language.