Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions enable text box and label on selection
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Arti Hajare
enable text box and label on selection
1 Answer(s)      3 years and 9 months ago
Posted in : JavaScript Questions


hello, Please tell me how to enable label and text box on selection of drop down list box. in drop down list box all values come from database. please reply.


Advertisement
View Answers

January 29, 2011 at 1:37 PM


Hi Friend,

Try this:

<%@page import="java.sql.*"%>
<html>
<script>
function ch(){
        document.getElementById('lab').innerHTML="Name";
        document.getElementById('txt').disabled=false;
    }
</script>
<form name="form">
<table>
<tr><td>Select</td><td><select id="sel" onchange="ch();">
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("Select * from data");
while(rs.next()){
%>
<option value="<%=rs.getInt("id")%>"><%=rs.getInt("id")%></option>
<%
}
%>
</select></td></tr>
<tr><td><label id="lab" disabled="true"></label></td><td><input type="text" id="txt" disabled="true"></td></tr>
</table>
</form>

Thanks



Related Tutorials/Questions & Answers:
enable text box and label on selection
enable text box and label on selection  hello, Please tell me how to enable label and text box on selection of drop down list box. in drop down list box all values come from database. please reply
enable text box
enable text box  Dear all I would like to enable a textbox by clicking on a button. pleas ehelp me out how can i do this regards JV
Advertisements
radio button selection should move the control to a text box that needs to be complete
radio button selection should move the control to a text box that needs to be complete  on selection of a radio button mouse should move to a particular text box that needs to be filled. How
interrelated two selection box
interrelated two selection box  hi i need two selection box .in 1 box all designation like manager, ceo etc , onclick on manager i should get list of managers names in second selection box.. like wise so on. from database
selection box linked with textarea
selection box linked with textarea    function get_val(tot_val1... detals i have in db with all fields .. like wise i have names in selection box sham... database in textarea line by line onclick selected text: eg:select: anand
sir plz help in design a jsp page whichis as follow username [_____] select [__>]password [_____] after selection then onlypassword text box is visible
sir plz help in design a jsp page   sir plz help in design a jsp page which is as follow username [ _ ] select [ > ] password [ _ ] after selection then only password text box is visible
select box and text box validations
select box and text box validations  hi, any one please tell me how to set validations for select box and text boxes using bean classes? thank you   Please visit the following link: http://www.roseindia.net/jsp/user
Text box Checking
Text box Checking  I want to Write only the word A-Z in a text box What is the code
two text box problem
two text box problem  i have two text box in two different pages and same variable use in two text box when enter value in first text box it's reflection show in second text box , how i reduce it in jsf ?   Hi Friend
Label
the functioning of the next text field. A label is also restricted to a single line of text as a button. The example below shows the significance of Label... Label      
Drop-down text selection in jsp/html
Drop-down text selection in jsp/html  Hi, I am trying to create JSP page where I have two drop-downs. There are two-sets of data - First set Categories- Movies, Books, Music and the Second set Genres- Action,Comedy,Romantic
java script text box
will click submit button the text should be submitted(it shows the value in alert). i also want the text box should generate in front of NEW button(next/prev...java script text box  hi, I created a button when i click
How to show autocomplete textbox values on combo box option selection using database?
How to show autocomplete textbox values on combo box option selection using database?  When I select option(i.e First Year) then it will show list of student names in auto-complete text box
Text box control--keypress event
Text box control--keypress event  In my form have a text box...My requirement is... when is type characters in that box... before typing the 3rd character the space should come automatically or programmatically...the sturucture
Drag a Text Box into dynamic positions
Drag a Text Box into dynamic positions  Plz can anyone tell how can i drag a text box using mouse or arrow keys... Im doing a accounts projects and i need this feature for cheque configuration
auto complete text box - Ajax
auto complete text box  How to create auto complete text box in jsp using ajax technology ? plz giv me steps wise code
my table should be reseted to new value upon the selection of the combo box..
my table should be reseted to new value upon the selection of the combo box..  import java.awt.Container; import java.awt.FlowLayout; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.sql.Connection
To display suggestions in a text box - Ajax
, to get the suggestions i mean when i enter the alphabet in a text box(For ex:'A'), the names that starts from 'A' have to display in the text box... enter the character in A in the text box, The names that starts from A have
how to create a text box using awt
how to create a text box using awt  give an example how creat multi buttons & text boxes
J2ME Text Box Example
J2ME Text Box Example       This application illustrates how to create the text box using TextBox class. The TextBox class is a Screen that allows the user to enter and edit text
Automatically display in text box - JSP-Servlet
Automatically display in text box  Dear Deepak Sir, When i enter some text in text box.That corresponding value in database,the value display in another text box using ajax. Thanks & Regards, VijayaBabu.M
Auto Complete Text Box - JSP-Servlet
Auto Complete Text Box  Please help me in Aotocomplete text box code. I m a java programmer. I m working on jsp tech. please give me the code for Autocomplete text box in which the values will generate from database table
create text box by clicking button and submittong text in text box using submit
create text box by clicking button and submittong text in text box using... is created. and i want to do that when i enter the text input in text box and when i... box in SOP). i also want the text box should generate in front of NEW button
How to assign a default value to text box in netbeans
How to assign a default value to text box in netbeans  I have a java application,and i want to assign a default variable to the textbox
how to display webservice response in a text box
how to display webservice response in a text box  Hallo, i have created a webservice and when i sended request to my webservice its sending proper response . the point is how to dispaly the response values in a text box usinj
Request[/searchMenu] does not contain handler parameter named 'function'. This may be caused by whitespace in the label text. - Subversion
Request[/searchMenu] does not contain handler parameter named 'function'. This may be caused by whitespace in the label text.  Hi, i am using... in the label text. jsp file = Search for - Shipping Category struts-config.xml
JSP Text Box properties. - JSP-Servlet
JSP Text Box properties.  How do I restrict a text box created in JSP page only for numbers.. example: I have a function something like this in actionscript UserID_txt.restrict = "0-9abc^d-zA-Z~!@#$%^&*()+_-'.,"; Do i have
Auto Complete Text Box - JSP-Servlet
Auto Complete Text Box - JSP-Servlet  Auto Complete Text Box Please help me in Aotocomplete text box code. I m a java programmer. I m working on jsp tech. please give me the code for Autocomplete text box in which the values
On click Checkbox values displayed in text box
On click Checkbox values displayed in text box  Hi sir, If i onclick the checkbox values should be displayed in text box, the following code is working properly in Internet Explorer browser but its not working in Google chrome
On click Checkbox values displayed in text box
On click Checkbox values displayed in text box  Hi sir, If i onclick the checkbox values should be displayed in text box, the following code is working properly in Internet Explorer browser but its not working in Google chrome
Change background color of text box - Java Beginners
Change background color of text box  Hi how can i change the background color to red of Javascript text box when ever user enters an incorrect value while on entering a correct value its background color should change green
Advertisements
 

 

 

DMCA.com