Results 1 to 5 of 5

Thread: Hourglass

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jul 2002
    Posts
    80

    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

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    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)

  3. #3
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    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)

  4. #4

    Thread Starter
    Registered User
    Join Date
    Jul 2002
    Posts
    80
    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

  5. #5
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    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
  •  



Click Here to Expand Forum to Full Width