|
-
Dec 9th, 2002, 02:31 PM
#1
Thread Starter
Registered User
Hourglass
I have 2 dropdown boxes and when a user make a selection on one the other gets populated with data. It take a few seconds to populate the 2nd dropdown but the form appears to look loaded. I want to prevent a user from making a selection in the 2nd dropdown until it is fully populated. Does anyone know how I can get around my problem? A hourglass might work but I don't know if it's possible to use with the server side script.
Thanks,
James
-
Dec 9th, 2002, 04:33 PM
#2
Given:
<select id="cboMyCombo">
<option></option>
<option>Sel</option>
<option>Sel 2</option>
</select>
<select id="cboTheOtherBox">
<option></option>
<option>Sel</option>
<option>Sel 2</option>
</select>
Then, in the ASPX page, you can do the following.
Code:
<script language="javascript" for="cboMyCombo" event="onpropertychange">
if(document.all){
document.all('cboTheOtherBox').style.display='none';
document.body.style.cursor="wait";
}else{
alert('please wait');
}
</script>
Make sure you put non-IE stuff in the else section. I think an alert is not appropriate, but other actions may be.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Dec 9th, 2002, 04:35 PM
#3
Also, do not change the onchange event. Dot-Net uses the onchange to keep track of controls.
That's why I choose to use the onpropertychange event.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Dec 9th, 2002, 06:39 PM
#4
Thread Starter
Registered User
Is this possible with a server side control? I'm still learning asp.net and I haven't use both client and server side script inside a server-side form. Can I use a HTML <select> tag inside a <form runat="server"></form>?
Thanks,
James
-
Dec 9th, 2002, 06:47 PM
#5
You can use it just fine.
If you want to add that code from the server, encapsulate it like this in a panel (lets say pnlTest)
pnlTest.Controls.Add(new LiteralControl("The script here"))
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
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
|