473,387 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can show and hide input field

idsanjeev
241 100+
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
5 6035
shweta123
692 Expert 512MB
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
241 100+
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
692 Expert 512MB
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
241 100+
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
241 100+
Hi Sweta
Thanks i got it
Nice programming
Jan 17 '08 #6

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

Similar topics

6
by: Steve Speirs | last post by:
Hi I'm trying to show/hide a simple piece of text and a text field on a form based on what choice is made from a drop down box. <select name="dropdown" size="1"> <option selected...
7
by: Mad Scientist Jr | last post by:
Through messing around I got IE6 (win xp) to show/hide a table row. I gave my <TR> an ID of "trRow" and trRow.style.display='none'; hides it trRow.style.display='block'; displays it (will any...
9
by: sergio | last post by:
Hi all, I have created the following script that will show/hide a menu based on checkboxes. It works fine in Opera but not on IE6! Does anybody knows a workaround this problem? Thanks for your...
7
by: FP | last post by:
I'm new to Java Script. I'm displaying comments people have made. Below each persons' comment I want to add 2 buttons "Reply" and "Amend". Clicking "Reply" would display an empty text field...
1
by: asilverpeach | last post by:
Hey Guys! Found some great scripts here on this topic but have to make to changes to the code that I can't seem to figure out. First, In the following code clicking on the headers shows the...
5
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
1
by: nithingujjar | last post by:
Hi, I need to to hide a field"addr_state1" based on a value in the drop down list field called "addr_country".i.e.,if addr_country.value=="in" then hide addr_state1 else , and if the value in the...
0
Frinavale
by: Frinavale | last post by:
This code snippet is just a little bit of fun. It demonstrates how you use JavaScript and CSS to show or hide columns in a table depending on whether or not a checkbox corresponding with the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.