johnsand
asked on
How do I parse a value in CGI
If I have a Drop-Down Combo box on a form ( such as Number of Employees ), with values like 1-15, 16-30, etc...
How do I parse the values into 2 seperate variables so I can check if it is within a range?
Example code would be appreciated...
How do I parse the values into 2 seperate variables so I can check if it is within a range?
Example code would be appreciated...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's exactly what I needed MITEK... Thanks...
Most languages have a split function which works something like this.
NewVars = split(your_string,"-")
FirstVar = NewVars(0)
SecondVar = NewVars(1)
But it is easier to change the dropdown box:
<select>
<option value="1">1-15
<option value="2">16-30
etc
</select>
You can name the values the way you want it and in the responding cgi process the data accordingly.