PDA

View Full Version : Form output question/issue


Rathric
11-11-2009, 08:44 PM
I have a form that users fill out that has some drop down options. After the user submits the form, it's written to memory and sent to an email address. One of the options that they can select on the form is as follows:

Select: 400 - Administrator (From drop down menu)

The values are inside a text file 400.txt

<option value=400>400--ADMINISTRATOR</option>
<option value=500>500--JR.ADMINISTRATOR</option>

When the form is sent to email, it comes out formatted like this:

Bask Template: 400

What I am trying to accomplish is to have the output display this:

Bask Template: 400--ADMINISTRATOR

This is what I have in my asp page.

<td style="width: 300px;">&nbsp;&nbsp;<label id="templatelbl">
<span class="asterisk">*</span>Bask Template:</label></td>
<td>

<select id="template" name="template" class="required select-notfirst" style="width: 350px;" onchange="TemplateChange()">

<% Response.Write("<option value=\"NONE\" selected=\"selected\">Please select a Template</option>"); %>
<% Response.WriteFile(Server.MapPath("App_data/400.txt")); %></select>
</td>

Am I missing something or any one have any ideas on how to do this correctly? This form is using Ajax/JQuery/JScript.

Old Pedant
11-11-2009, 09:05 PM
The obvious answer is to change the contents of App_data/400.txt to *GET RID* of the value= part of each <option> so it just looks like this:

<option>400--ADMINISTRATOR</option>

When a selected <option> doesn't have any value=, then the text between <option> and </option> is sent on to the next page.

If that's not something you are allowed to do, then you'll need to fix this with JavaScript code in the browser.

Rathric
11-11-2009, 09:23 PM
Oh I feel like a nut....didn't even think of doing that. Works perfect! thanks a bunch!!!

Rick