Forums
This topic is locked
assign value----help wanted!!
Posted 25 Jul 2002 17:37:10
1
has voted
25 Jul 2002 17:37:10 Angela Zhou posted:
what i want to do is: assign values to a list of choices, whenever a user makes a choice, a related value will appear in a related table for purpose of later calculation.Anyone has done this before? please help!!! Thanks a lot!!!
Itsmicky
Replies
Replied 25 Jul 2002 20:01:00
25 Jul 2002 20:01:00 aegis kleais replied:
Well, if you're using a SELECT box, it's rather simple.
<select name="selectBox" onChange="javascript:setHidden()">
<option value="red">I like red</option>
<option value="green">I like green</option>
<option value="blue">I like blue</option>
<option value="cheese">I like cheese</option>
</select>
<input type="hidden" name="whatILike">
And then in a javascript code, place:
function setHidden(){
document.all.whatILike.value = document.all.selectBox.value;
}
This will place the VALUE of the selected option into the hidden form. Then to place it all into a table, setup the insert/update so that the hidden form places that data in the field you want.
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
<select name="selectBox" onChange="javascript:setHidden()">
<option value="red">I like red</option>
<option value="green">I like green</option>
<option value="blue">I like blue</option>
<option value="cheese">I like cheese</option>
</select>
<input type="hidden" name="whatILike">
And then in a javascript code, place:
function setHidden(){
document.all.whatILike.value = document.all.selectBox.value;
}
This will place the VALUE of the selected option into the hidden form. Then to place it all into a table, setup the insert/update so that the hidden form places that data in the field you want.
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Replied 25 Jul 2002 20:06:32
25 Jul 2002 20:06:32 Angela Zhou replied:
Actually i am not a programmer. I am doing everything using application instead... i know a little SQL, nothing else<img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>
But at least i know now that this is doable...the rest is to figure it out from a non-programmer's perspective<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Thanks anyway!
Itsmicky
But at least i know now that this is doable...the rest is to figure it out from a non-programmer's perspective<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Thanks anyway!
Itsmicky
Replied 26 Jul 2002 00:31:19
26 Jul 2002 00:31:19 aegis kleais replied:
Im a designer by trade, but I found that the market wants a developer instead (actually, they'd like BOTH, but dev positions are what needs to be filled moreso thatn design)
Anyways, I got into ASP and SQL and the stuff is pretty nifty. Soon I shall have the power of both worlds! MWA HA HA! Online applications that LOOK COOL! MWA HA HA HA!
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Anyways, I got into ASP and SQL and the stuff is pretty nifty. Soon I shall have the power of both worlds! MWA HA HA! Online applications that LOOK COOL! MWA HA HA HA!
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])