...

View Full Version : Yet Another Triple box Javascript question



Cpen
09-21-2005, 10:05 PM
I coded this boxes with several layers.. is there any way i can add a "add button" that will let me add this to a table with figures? Example:

The dropdown boxes and selection:
triplebox1 2 3
[example] [stage1] [stage2]
1st layer [nike] [$100]
[shoe] [shoe 2] [$200] [Add]
[shoe 3] [300]

so on and so forth..


let say I choose Shoe Nike that cost 100.00

I have the Add button to post to the label on a form on the SAME page.

Form below the dropdownbox

description | Price
---------------------------------------------------
Shoe Nike | 100.00
---------------------------------------------------
Total |100.00


I asked this on the asp.net section by mistake. Thanks for the help in advance.

CrAzY_J
09-22-2005, 01:17 AM
uh..here's something small, hope it helps you out:


<form name='form1'>
<select name='sel' onchange='poo()'>
<option value='value1' id='v1'>value1</option>
<option value='value2' id='v2'>value2</option>
<option value='value3' id='v3'>value3</option>
<option value='value4' id='v4'>value4</option>
</select></form>

<div id='value1' style='display:none'>
Option1 information
</div>
<div id='value2' style='display:none'>
Option4 information
</div>
<div id='value3' style='display:none'>
Option3 information
</div>
<div id='value4' style='display:none'>
Option2 information
</div>

<script>
function poo(){
document.getElementById(document.form1.sel.options[document.form1.sel.selectedIndex].value).style.display="block";
}
</script>

Cpen
09-22-2005, 02:28 PM
yes yes! very close. I want them to be null untill you press a "Add button"

then it will post to a label. So basically a user can choose his choices from three dropdown lists then he presses the add button. The add button then knows what 3 captions the user has chosen, and texts it in a label to be viewed in a form with the totals(Kinda like a shopping cart). Thanks in advance.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum