Jump to content
houssam_ballout

show 2 texbox on dropdown box

Recommended Posts

Hello,i had the following scenario in which I need your help: I had a drop down box: <option value="client-all.php">1</option><option value="supplier-all.php">2</option><option value="koshofat.php">3</option> <input type="button" onClick="location=document.koshofat.URL.options[document.koshofat.URL.selectedIndex].value;" value="go" class="button2"> its good for 1, 2 , but I need to show 2 textboxes when the user select 3 and hide them when user select different than 3 (After that when he click submit, I will get the values through POST variables), I need your help in scripting my issue? Thanks in advance

Share this post


Link to post
Share on other sites

1. Write a function that captures the select element's onchange event. 2. The function gets the selected index. If the index is 0 or 1, hide the textareas. If the index is 2, show the textareas. 3. There are two ways to change visibility. 3a. Change the CSS display property of the textareas (or a div that contains both of them).Use display:none to hide something. Use display:block or display:inline (or any other value) to make it visible. 3b. Change the CSS visibility property. Usevisibility:hidden to hide something. Use visibility:visible to make it visible. Try both. Changing visibility has a very different effect than changing display.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...