...

View Full Version : Send User To URL If Product Is For Sale



surge42
01-07-2004, 02:34 AM
I have a page that asks customers to vote for products they want to see for sale in the near future.
The products are listed in a pull down. I use a script from http://www.bignosebird.com that collects the votes via a Perl script.

here's what the pull down looks like.


<select name="ITEM_1" size="22" id="select7">

<option value="ITEM_1|No Vote Sent">- - Select Products For 2004 - -</option>
<option value="ITEM_1|Hard Drives">Hard Drives</option>
<option value="ITEM_1|iPod">iPod</option>
<option value="ITEM_1|Computer cases">Computer cases</option>
<option value="ITEM_1|Memory Sticks">Memory Sticks</option>

</select>

FYI: The value "ITEM_1" allows the script to tally the votes for that specific pull down.

My objective is to send the user to a page if the product is already available for sale at our store. For example If the customer chooses to vote for iPod, is there a way to Have an onBlur (or onChange I guess) event that would send them to a page providing promotional info about our iPods?


I'm guessing the best way to approach the solution is to use URL to the iPod sales page as the value.


<option value="http://www.link_to_iPod_sales_page.html">I Pod</option>

I've tried to use Dreamweaver's Jump menu script but it wont work because when the customer wants to vote on a product that's not at our store the script still uses the value as a link. See below for an example



<script>

function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
</script>


<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">

<option value="ITEM_1|No Vote Sent">- - Select Products For 2004 - -</option> > BAD LINK <
<option value="ITEM_1|Hard Drives">Hard Drives</option> > BAD LINK <
<option value="http://www.apple.com/iPod/">iPod</option> > GOOD LINK <
<option value="ITEM_1|Computer cases">Computer cases</option> > BAD LINK <
<option value="ITEM_1|Memory Sticks">Memory Sticks</option> > BAD LINK <

</select>


Could you provide a script solution that does not try to use value ="ITEM_1|any product not available for sale" as a link but will if the value is value="http://link to any product available for sale ?

Know of any examples on the net that come close to this request? I've been looking high and low and have found nothing close.


Thanks in advance for any input on this one

surge42
01-07-2004, 02:36 AM
Hmmm, lets see.

The pull down is within a form tag that sends the results to the vote script.

Also within the <form> tag there would be a script that would send the user to a page if that product item is already available for sale.

There will be no dynamically created content in this solution.
The products available for sale will have their own splashy sales html pages.

When you refer to "object" I'm a bit confused. I guess my answer would be the object is the html document holding the sales info for the products.

I think the best even handler would be onBlur (correct me if I'm wrong) because we need the customer to get shot to the product page when they select the product in the pull down not when they hit the send button at the bottom of the form.

surge42
01-07-2004, 02:39 AM
Hmmm, lets see.

The pull down is within a form tag that sends the results to the vote script.

Also within the <form> tag there would be a script that would send the user to a page if that product item is already available for sale.

There will be no dynamically created content in this solution.
The products available for sale will have their own splashy sales html pages.

When you refer to "object" I'm a bit confused. I guess my answer would be the object is the html document holding the sales info for the products.

I think the best even handler would be onBlur (correct me if I'm wrong) because we need the customer to get shot to the product page when they select the product in the pull down not when they hit the send button at the bottom of the form.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum