scott9614
08-09-2003, 09:00 PM
I am using a dropdown list which has the value set to the cost of the item, I use this to update a null field next to the dropdown with the price or "value" and also use it in calculating the total and sales tax. example (<option value="149.95">)
I know that if I change the option value to a string with the url inside, (<option value="http://www.netscape.com">), I can achieve the effect I am looking for . That is, I have a "dynamic" link called "view" that I would like to change based on the users selection from the dropdown. However, if I change the value to a string I loose my calculation functions!
Examples of code would be great, I am still very new to this language!!
Here are a few snippets of my code to give you a better idea what I'm talking about, still not quite sure if I make sense talking about this language!
function ProductView() {
var PicLink="http://www.yahoo.com";
}
<A href="Javascript:window.open[PicLink]">view</A>
<select name="product_case" onchange="order_price()" onchage="ProductView()" tabindex="1">
<option value="0">
<option value="149.95">THE PRODUCT ($149.95)
Ultimately what I would like is....
function ProductView() {
item1_index = document.order.product_case.selectedIndex;
if (document.order.product_case.options[item1_index].value=="149.95");
var PicLink="http://www.yahoo.com";
}
this would allow me to add if statements for all drop down options and change the URL accordingly, i hope...
Again, thanks for your time and help, I'm so frustrated I'm ready to paypall someone!
Scott
I know that if I change the option value to a string with the url inside, (<option value="http://www.netscape.com">), I can achieve the effect I am looking for . That is, I have a "dynamic" link called "view" that I would like to change based on the users selection from the dropdown. However, if I change the value to a string I loose my calculation functions!
Examples of code would be great, I am still very new to this language!!
Here are a few snippets of my code to give you a better idea what I'm talking about, still not quite sure if I make sense talking about this language!
function ProductView() {
var PicLink="http://www.yahoo.com";
}
<A href="Javascript:window.open[PicLink]">view</A>
<select name="product_case" onchange="order_price()" onchage="ProductView()" tabindex="1">
<option value="0">
<option value="149.95">THE PRODUCT ($149.95)
Ultimately what I would like is....
function ProductView() {
item1_index = document.order.product_case.selectedIndex;
if (document.order.product_case.options[item1_index].value=="149.95");
var PicLink="http://www.yahoo.com";
}
this would allow me to add if statements for all drop down options and change the URL accordingly, i hope...
Again, thanks for your time and help, I'm so frustrated I'm ready to paypall someone!
Scott