By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,009 Members | 2,859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,009 IT Pros & Developers. It's quick & easy.

How can show and hide input field

idsanjeev
100+
P: 241
Hello
its a urgent
i have a form that has option select from table and click on add for requition of material that is in loop
my need is if select option is cd or floppy then automatic show input field for input purpose and if option is selected cartidge then hide input field and the requestion is submitted one by one in loop i can't able to do this.there are three field in select option cd,floppy and cartidge
code for select option


Expand|Select|Wrap|Line Numbers
  1. <option Selected Value>Select Item</option>
  2. <%
  3. Set RSITEM = CON.EXECUTE("SELECT * FROM CONSUM_ITEMS ORDER BY Item_code")
  4. %>
  5. <%
  6. Do While Not RSITEM.EOF
  7. %>        <option Value="<%=RSITEM("Item_code")%>"><%=RSITEM("Item_desc")%></option>
  8. <%
  9.  
  10. RSITEM.MoveNext
  11. Loop
thanks
Jan 16 '08 #1
Share this Question
Share on Google+
5 Replies


shweta123
Expert 100+
P: 692
Hi ,

Do you mean that you want to show or hide textbox on selection of value from Select List?
You can do this functionality by calling a javascript function on onchange event of Select.
e.g.

Expand|Select|Wrap|Line Numbers
  1.  
  2.       function callme(objSelect)
  3.         {
  4.             if((objSelect.option[objSelect.selectedIndex).text ==  "cd") ||  (objSelect.option[objSelect.selectedIndex).text ==  "floppy ")
  5.              {
  6.               document.getElementId('txtInput").visible = true;
  7.              }
  8.           else
  9.             {
  10.              document.getElementId('txtInput").visible = false;
  11.             }
  12.         }



Hello
its a urgent
i have a form that has option select from table and click on add for requition of material that is in loop
my need is if select option is cd or floppy then automatic show input field for input purpose and if option is selected cartidge then hide input field and the requestion is submitted one by one in loop i can't able to do this.there are three field in select option cd,floppy and cartidge
code for select option


Expand|Select|Wrap|Line Numbers
  1. <option Selected Value>Select Item</option>
  2. <%
  3. Set RSITEM = CON.EXECUTE("SELECT * FROM CONSUM_ITEMS ORDER BY Item_code")
  4. %>
  5. <%
  6. Do While Not RSITEM.EOF
  7. %>        <option Value="<%=RSITEM("Item_code")%>"><%=RSITEM("Item_desc")%></option>
  8. <%
  9.  
  10. RSITEM.MoveNext
  11. Loop
thanks
Jan 16 '08 #2

idsanjeev
100+
P: 241
hi
where i have to use this. and other is if the option is selected cd or flopyy then
show input field automatic and option selected cartidge then hide input field automatic means when option is selected go on next work the form will be refresh wiht condion auto
Jan 16 '08 #3

shweta123
Expert 100+
P: 692
Hi,

If you want to call the function onchange event of your Select listbox then you can call it this way :
<Select id="Select1" onchange = "callme(this);">




hi
where i have to use this. and other is if the option is selected cd or flopyy then
show input field automatic and option selected cartidge then hide input field automatic means when option is selected go on next work the form will be refresh wiht condion auto
Jan 16 '08 #4

idsanjeev
100+
P: 241
Hi Sweta
i wants to show and hide input field of purpose based on selected option
here is attachment file soryy but i can't understand where is the problems becouse it not work please revise
Jan 17 '08 #5

idsanjeev
100+
P: 241
Hi Sweta
Thanks i got it
Nice programming
Jan 17 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.