tonyyeb
tonyyeb

Reputation: 719

Return value and item string from HTML Select using ASP

I have a select box on a classic ASP page which looks like this:

<select name='reason' id='reason'>
<option value='77000005471253'>Family issue</option>
<option value='77000005471256'>Holiday</option>
<option value='77000005471254'>Medical</option>
<option value='77000005471255'>Meeting</option>
</select>

I can return the value element (e.g. 77000005471253) but I would also like the items string value (e.g. Family Issue). Is this possible using Classic ASP?

Thanks in advance

Upvotes: 1

Views: 1479

Answers (1)

Kangkan
Kangkan

Reputation: 15571

One way is to add the string value also into the value with some delimeter and get both using a split operation on post. Otherwise, you can add a javascript to put the string value into a hidden field on selection change of the select element.

Upvotes: 1

Related Questions