Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating a dynamic URL from form fields 1

Status
Not open for further replies.

fortytwo

Technical User
Apr 18, 2000
206
GB
Hi All,

I have a form with two drop down menus, the values of which I want to add into a URL that is loaded in a pop-up window.

Here is the form I am using:
[tt]
<form>
<select name="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>

<select name="size">
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
</select>
</form>
[/tt]

And I would ideally like the values of these to be interpolated in the URL that is used by this button:

[tt]
<input type="image" value="submit" name="submit" src="/images/add.gif" border="0" onClick="window.open('cart.pl?product_id=1&action=add&size=[VALUE OF SIZE FIELD]&quantity=[VALUE OF QUANTITY FIELD]','win1','width=470,height=370,scrollbars=yes')" />
[/tt]

Does anyone have any pointers on how I might do this?

Many thanks
Will.

will@hellacool.co.uk
 
Try

<input type="image" value="submit" name="submit" src="/images/add.gif" border="0" onClick="window.open('cart.pl?product_id=1&action=add&size='+this.form.size.value+'&quantity=' + this.form.quantity.value,'win1','width=470,height=370,scrollbars=yes')" />
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top