SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2011
    Location
    Aurangabad
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to hide and show textbox after select listmenu box value

    <select name="select" >
    <option value="0">Select any one</option>
    <option value="hide">Trainee</option>
    <option value="show">Product</option>
    </select>

    <td><input name="designation" type="text" id="designation" /></td>
    <td><input name="organization" type="text" id="organization" /></td>

    please help me how to hide both text box after select Trainee value from listmenubox
    and after select Product both textbox show

    please help how to hide and show after select value from listmenu box, textbox hide and when i select another value then it show

    please help me as possible as

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    1. gain a reference to the form
    2. gain a reference to the select field
    3. associate a function with the onchange event of that select field
    4. the function checks the selected option's value, and:
    4.1 hides the two text boxes
    4.2 or shows the two text boxes

    Do you know how to achieve those basics as outlined above?
    Let us know if you have trouble with any of the above, and we'll take you through the best ways to achieve them.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2011
    Location
    Aurangabad
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank's for replay
    i have try some type of function and code but not work that
    may u help me , some practicaly or with sourcecode then i will get some good info
    give me some code for doing that

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by RohitTripathi View Post
    give me some code for doing that
    There is a symbiotic relationship between HTML and JavaScript.
    Any script that is given relies entirely on the HTML code you will put it with.

    What is the HTML form that your script will need to work with, and what script do you currently have?

    We will happily teach people how to do things here. Do you want to learn?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •