I need to add modification relate with: Button value
GOTHERE and input-text name
OP,
So I added myself two more inputText boxes (
PAID and
REST),
so i need when i click on GOTHERE button and it output result in inputTex
OP,
also same number it output in textBox REST, then
when i write some Number in PAID textBox, it
cuts automatically from REST textBox.
AND HERE IS THE NORMAL CODE:
<form name="dynamiccombo">
<select name="stage2" size="1" onChange="displaysub()">
<option value="#">This is a place Holder text </option>
</select>
<input type="button" name="test" value="Go!" onClick="gothere()">
Currency: <input name="op" /><p><br>
Paid: <input class="paid" name="paid" id="paid" onChange="update()"/><p>
Rest: <input class="rest" name="rest" id="rest" onChange="update()" /> <br>
</form>
<script>
<!--
//2-level combo box script- by javascriptkit.com
//STEP 1 of 2: DEFINE the main category links below
//EXTEND array as needed following the laid out structure
//BE sure to preserve the first line, as it's used to display main title
var category=new Array()
category[0]=new Option("SELECT A CATEGORY ", "") //THIS LINE RESERVED TO CONTAIN COMBO TITLE
category[1]=new Option("Shose", "combo1")
category[2]=new Option("Clothe", "combo2")
//STEP 2 of 2: DEFINE the sub category links below
//EXTEND array as needed following the laid out structure
//BE sure to preserve the LAST line, as it's used to display submain title
var combo1=new Array()
combo1[0]=new Option("Sandal","38")
combo1[1]=new Option("Boot","50")
combo1[2]=new Option("BACK TO CATEGORIES","") //THIS LINE RESERVED TO CONTAIN COMBO SUBTITLE
var combo2=new Array()
combo2[0]=new Option("Shirt","30")
combo2[1]=new Option("T-Shirt","45")
combo2[2]=new Option("BACK TO CATEGORIES","") //THIS LINE RESERVED TO CONTAIN COMBO SUBTITLE
var curlevel=1;
var cacheobj=document.dynamiccombo.stage2;
function populate(x){
for (m=cacheobj.options.length-1;m>0;m--){
cacheobj.options[m]=null;
}
selectedarray=eval(x);
for (i=0;i<selectedarray.length;i++){
cacheobj.options[i]=new Option(selectedarray[i].text,selectedarray[i].value);
}
cacheobj.options[0].selected=true
}
function displaysub(){
if (curlevel==1){
populate(cacheobj.options[cacheobj.selectedIndex].value);
curlevel=2;
}
else {
gothere();
}
}
var MyVariable; // Global Variable
function gothere(){
if (curlevel==2){
MyVariable=eval(cacheobj.options[cacheobj.selectedIndex].value);
if (MyVariable){
var frm=cacheobj.form;
frm.op.value=MyVariable + " US";
}
else {
curlevel=1;
populate(category);
}
}
}
//SHOW categories by default
populate(category)
//-->
</script>
Thanks in advance.