Results 1 to 3 of 3

Thread: Asp.net developer

  1. #1
    PerezMorris is offline Senior Member
    Join Date
    Dec 2009
    Posts
    250
    Rep Power
    3

    Default Asp.net developer

    Hi, I am asp.net developer. In my one form there is dropdown list menu with the name of the cities like Washington, New York, California Other and a text box that would allow the user to enter the name of the city if other is chosen. How to enable validation on the text box if other is chosen. Please help me out with your valuable suggestions. I would be very grateful.

  2. #2
    HallMiller is offline Senior Member
    Join Date
    Dec 2009
    Posts
    251
    Rep Power
    3

    Default

    The script that I have mentioned will definitely help you. Simply write a javascript function like this
    on button click or on onkeypress event of text box

    Code:
    function validate()
    {
    if(document.getelementbyid("ur dropdownlist").value=="other")
    {
    if(document.getelementbyid("ur textbox").value=="")
    {
    alert("please enter city name");
    return false;
    }
    
    }
    
    }

  3. #3
    AllenBrown is offline Senior Member
    Join Date
    Dec 2009
    Posts
    240
    Rep Power
    3

    Default

    Try out this code:

    Code:
    On_page load
    {
    RequiredFieldValidator1.Enabled = false;
    }
    
    if (DropDownList1.SelectedItem.Text == "Other")
            {
                RequiredFieldValidator1.Enabled = true;
            }
            else
            {
                RequiredFieldValidator1.Enabled = false;
            }

Similar Threads

  1. Developer for Linux on ARM
    By Alfred Hitchcock in forum Latest Hardware News
    Replies: 0
    Last Post: 03-03-2010, 08:53 AM
  2. Web Developer Express
    By HowardAllen in forum General Internet Terms
    Replies: 2
    Last Post: 01-29-2010, 05:29 PM
  3. The Developer Tab
    By uanalks467 in forum Operating System
    Replies: 0
    Last Post: 10-21-2008, 08:27 AM
  4. Add the Developer tab
    By zonal5747 in forum General Software Terms
    Replies: 0
    Last Post: 06-26-2008, 02:02 PM
  5. ASP.NET 2.0 Visual Web Developer
    By vandana43 in forum Applications
    Replies: 0
    Last Post: 03-06-2008, 08:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48