|
-
Nov 19th, 2001, 12:00 PM
#1
Thread Starter
Evil Genius
javascript one
1) Page1.htm - contains only a submit button control.
2) User clicks this & sends page1 to Page2.asp
3) Page3.asp contains <select> and hidden field.
4) User selects from the combobox.
5) This selection text is placed into the hidden field.
6) The page then is then automatically submitted - to itself.
4-6 keep going in a loop, every time the user chooses an entry, the page reloads. Now when the page loads, the combobox shows the default first entry. What I'd like is for this to show trhe last selected entry. 
What I've done is set up a body_onload event which loops through all the entries in the combobox and selects the one which matches the request pages hidden text field's text:
Code:
function SelectChosenGam() {
if (request.form("hidChosen") != "") {
var intCounter;
for(intCounter=0; intCounter<theForm.combo1.options.length; intCounter++) {
if (theForm.combo1.options[intCounter] == Request.Form("hidChosen")) {
theForm.combo1.selectedIndex = intCounter;
}
}
}
}
This works fine when the page2.asp page is submitting to itself. But then I realised that page1.htm submits to this page also & doesn't have the hidden field. How can I trap for this please ?
Last edited by alex_read; Nov 20th, 2001 at 04:57 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|