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. how can desable and enable the input filed based on option

how can desable and enable the input filed based on option

Scheduled Pinned Locked Moved Web Development
help
3 Posts 2 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.
  • I Offline
    I Offline
    idsanjeevjha
    wrote on last edited by
    #1

    Hi every one can any one help(using asp,vbscripts) its urgent i wants to slect option from combo when select type is floppy and cd then enput type is enable if select type is cabinate then desable thanks in advance to response regards sanjeev jha

    sanjeev

    M 1 Reply Last reply
    0
    • I idsanjeevjha

      Hi every one can any one help(using asp,vbscripts) its urgent i wants to slect option from combo when select type is floppy and cd then enput type is enable if select type is cabinate then desable thanks in advance to response regards sanjeev jha

      sanjeev

      M Offline
      M Offline
      MayyMagdy
      wrote on last edited by
      #2

      Put onChange="Javascript: disableInputFields()" in your select field then put the following JS and chnage names of fields/form and so on.. function disableInputFields() { if (document.Form1.ddltype.value == "cabinate") document.Form1.inputName.disabled=true; else document.Form1.inputName.disabled=false; } hope it helps

      I 1 Reply Last reply
      0
      • M MayyMagdy

        Put onChange="Javascript: disableInputFields()" in your select field then put the following JS and chnage names of fields/form and so on.. function disableInputFields() { if (document.Form1.ddltype.value == "cabinate") document.Form1.inputName.disabled=true; else document.Form1.inputName.disabled=false; } hope it helps

        I Offline
        I Offline
        idsanjeevjha
        wrote on last edited by
        #3

        Hi Thanks to reply my problems is here when the option 1 selected and added on next addtion it not work for 2, and 3 position but my need is selection depends on user so it have to work fedomeally becouse in one requestion user can submit request with all option it work when first visble option is selected [code] function toggle_state(obj) { // here we check the value of your select-box var val = obj.value == 1; var input_node = document.getElementById('purpose'); input_node.style.visibility = val ? 'hidden' : 'visible'; } <input type="text" name="purpose" style="visibility:hidden; width:400px" maxlength="150" value=<%=porpose%>> [/code]

        sanjeev

        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