Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. JavaScript with DropDownList

JavaScript with DropDownList

Scheduled Pinned Locked Moved ASP.NET
javascriptquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mahesh J
    wrote on last edited by
    #1

    Hi... I am using a dropdown list with autopostback = true. I am performing validation using JavaScript with the fallowing function function ddlCheck() { var dt = document.getElementById("<%= ddlClassRoomNo.ClientID%>").value; if (parseInt(dt) != 0) { return true } else { alert('Select a value') return false } } i am calling this with setting attributes to the control on the page load event just like this ddlClassRoomNo.Attributes.Add("OnChange", "return ddlCheck();") it works fine but when the condition is true the AutoPostback is not happening how can i solve this. Thanks in Advance

    K 1 Reply Last reply
    0
    • M Mahesh J

      Hi... I am using a dropdown list with autopostback = true. I am performing validation using JavaScript with the fallowing function function ddlCheck() { var dt = document.getElementById("<%= ddlClassRoomNo.ClientID%>").value; if (parseInt(dt) != 0) { return true } else { alert('Select a value') return false } } i am calling this with setting attributes to the control on the page load event just like this ddlClassRoomNo.Attributes.Add("OnChange", "return ddlCheck();") it works fine but when the condition is true the AutoPostback is not happening how can i solve this. Thanks in Advance

      K Offline
      K Offline
      kapil bhatnagar
      wrote on last edited by
      #2

      try this: if (parseInt(dt) != 0) { Form1.submit(); }

      M 1 Reply Last reply
      0
      • K kapil bhatnagar

        try this: if (parseInt(dt) != 0) { Form1.submit(); }

        M Offline
        M Offline
        Mahesh J
        wrote on last edited by
        #3

        Hi.. Thanks. I checked the code but it is not working

        S 1 Reply Last reply
        0
        • M Mahesh J

          Hi.. Thanks. I checked the code but it is not working

          S Offline
          S Offline
          Sandeep Akhare
          wrote on last edited by
          #4

          It does not work with drop downlist even though you retrun true postback will not occure -- modified at 8:34 Wednesday 26th September, 2007

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups