Klaas Seelen wrote:
On a webpage I have three comboboxes. The second and the third are
dynamically filled dependent from the choice in the first combobox.
Each choice in all three boxes consist of a numeric value and a
string. This is done through a javascript and it uses the numeric
values of the first box. When submitting the page to an asp script I
don't want to post these numeric values but the selected strings. Can
this be done???
Let me first state that I would be inclined to get rid of the numbers
altogether. If you are not interested in them at submission, why bother
putting them into the document in the first place?
Back to your question. There are several ways to do this. Perhaps the most
straightforward is to change the value at submit:
option.value = option.text // [1],[2]
If your SELECT elements (they are not "comboboxes ") are of the "select-one"
type [3], then it suffices to do it this way:
sel[sel.selectedInd ex].value = sel[sel.selectedInd ex].text
For "select-multiple" elements, you should iterate through the entire set of
option elements.
Please bear in mind that "option" and "sel" are object references,
representing something like
document.forms["myForm"].elements["mySelectElemen t"][i] and
document.forms["myForm"].elements["mySelectElemen t"], respectively.
[1]
http://msdn.microsoft.com/workshop/a...es/value_3.asp
[2]
http://msdn.microsoft.com/workshop/a...ies/text_3.asp
[3]
http://msdn.microsoft.com/workshop/a...ies/type_9.asp
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.