?
Solved

value of name/value pair to provided by a variable?

Posted on 2003-02-28
6
Medium Priority
?
172 Views
Last Modified: 2013-12-25
I have a form that sends info to a shopping cart.  One of the items sent is a product ID, it's called ID_NUM (curiously enough).  Right now it's set with a code along the lines of:

      <input type=hidden name="ID_NUM" value="mary 28">

I need to be able to set the value on the fly by equating it to a variable that's unique to the product.  I don't want to have page after page of html with the only difference on any of them being a few characters that id the product.

One of the things passed to this page is a unique id number that's in a variable name pix .  I tried:

      <input type=hidden name="ID_NUM" value=pix>

All I get passed to the cgi is the string "pix"!

You can see the actual code at:

      http://www.jwparker.com/000/left.htm

Any ideas?
 



0
Comment
Question by:jwparker110498
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 7

Expert Comment

by:markhoy
ID: 8047767
what hosting platform are you using? perl or asp? is the shopping cart perl, asp or javascript?
0
 
LVL 7

Expert Comment

by:markhoy
ID: 8047774
Looks like you use .js so I'd delete this question aND repost in the javscript forum.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 200 total points
ID: 8049118
either you need to create a uniq HTML for each value, or use <SELECT> .. <OPTION> instead of <INPUT>

JavaScript (or any other browser scripting) only works if the user allows it.
0
 
LVL 2

Assisted Solution

by:TS020
TS020 earned 200 total points
ID: 9051854
Actually, what it appears that you need to do is have a CGI create the page with the forms that you are currently using, where ID_NUM is passed to the CGI through POST or GET, and thus, you would use that information to fill the hidden data field.  I have to do this all the time.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question