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




Have Programming Question? Ask it here!
 
 
 


Shruti Bansal
capture
1 Answer(s)      3 years and 3 months ago
Posted in : HTML


How can i capture values or text selected in drop down menu or in combo box or in any input forms and print it on the same page ?? also the selected value i want to store it in data base. how can i do that??

plzzzz reply soon...!


Advertisement
View Answers

May 31, 2011 at 1:13 PM


1)selCombo.html:

<html>
<script>
function selValue(){
var mytext = document.form.sel.options[document.form.sel.selectedIndex].text;
document.getElementById('lab').style.visibility="visible";
document.getElementById('val').style.visibility="visible";
document.form.val.value=mytext;
}

</script>
<form name="form" method="post" action="http://localhost:8080/examples/jsp/save.jsp">
<select name="sel" id="sel" onchange="selValue();">

              <option value="<-Select->"><- Select- ></option>
              <option value="India">India</option>
              <option value="USA">USA</option>
              <option value="Srilanka">Srilanka</option>
              <option value="Japan">Japan</option>
              <option value="Australia">Australia</option>

            </select>
            <br><br>
            <label id="lab" name="lab" style="visibility:hidden;">You have selected:</label><input style="visibility:hidden;" id="val" type="text" name="val" ><br>

            <input type="submit" value="Save" >
</html>

2)save.jsp:

<%@page import="java.sql.*"%>
<%
try{
String str=request.getParameter("val");
Class.forName("com.mysql.jdbc.Driver").newInstance();  
 Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");  
Statement st=con.createStatement();
int i=st.executeUpdate("insert into country(countryname) values('"+str+"')");
out.println("Inserted Successfully!");
}
catch(Exception e){
    System.out.println(e);
}
%>


Related Tutorials/Questions & Answers:
capture
capture  How can i capture values or text selected in drop down menu or in combo box or in any input forms and print it on the same page ?? also the selected value i want to store it in data base. how can i do that?? plzzzz
webpage capture
webpage capture   webpage capture source code using jsps and servlets
Advertisements
Screen Capture
Screen Capture  How to capture the screen using jsps and servlets
How to capture screenshot in url?
How to capture screenshot in url?  Hi, How to capture screenshot and it will store the capture image in url like this http://localhost/xxx/yyy/ it wil not sore C:\ or D:\ it should store like this http://localhost/xxx/yyy
Capture a image and upload to server
Capture a image and upload to server  Hai team i have trouble to capture a image and upload to server in java me........... So i want a code immediately,.......To capture a image and upload to server in j2me...... If you give
php web page capture
php web page capture  How to capture the history of a web page using PHP
url capture in javaScript
url capture in javaScript  Hi All, I m creating a bookmark to capture the url of the site and the user's input in the bookmark,in javaScript.this url and user input is to be saved into DB. Following is my code.Result
can I capture wifi trafic in windows?
can I capture wifi trafic in windows?  Hi, can I analyse wifi trafic in windows and not in linux ? thank you
How to capture output from console into textarea in java?
How to capture output from console into textarea in java?  Hi, I would like to know how can we display the result of a program in java into a textarea instead of displaying it on console. Thanks
How to capture picture from webcam using java
How to capture picture from webcam using java  i want catch the image from web-cam using jsp, If anyone knows please answer me
How to capture video and then how to store it in mobile memory
How to capture video and then how to store it in mobile memory  Hello there, I'm developing a mobile application where i'm capturing video from... but they are not working properly some of them capture video but doesn't allow me
Capture browser file download event - JSP-Servlet
Capture browser file download event  Hi, I appreciate your help and thaanks for that.But my question was when filedownload dialog box comes in browser,how we can come to know that user has clicked on Open,save or cancel button
Data Capture from resume - JSP-Servlet
Data Capture from resume  Hi Sir, In My Application, when i Upload a resume the relevant columns like name,phone,email,skills etc need to be captured automatically and must be stored into the database. Please solve
how to capture jsf form data - Java Server Faces Questions
how to capture jsf form data  hi , i have a jsf page with username ,password and submitt button,if i submitt the data then it has to store in the database this is the task i have to do plese tell me the procedure how to do
how to capture IE browser FileDownload box open ,save and cancel event - JSP-Servlet
how to capture IE browser FileDownload box open ,save and cancel event  I have a JSP page which allows user to download a file.When user click... to capture open,save and cancel event of filedownload box in javascript. Please
Capturing Text in a Group in a Regular Expression
Capturing Text in a Group in a Regular Expression       This section illustrates you how to capture.... In this section, you will capture the text which is completely made by alphabet
Using the Captured Text of a Group within a Replacement Pattern
illustrates you how to capture the string or text through the regular expression... expression of the code which has been used to capture each and every word one by one
question
question  how to capture web snippets using java or java script
Caputuring screen shot
Caputuring screen shot  How to to capture screen shot for a computer on internet
Junit
Junit  How to capture junit error reports in to a file
Flex event
Flex event  hi...... How to capture and event if the component is disabled? please give an example..... Thanks in advance
Servlet Init method
Servlet Init method  can we capture the form data into the init method of the servlet
Java HTML scraping - Development process
Java HTML scraping   Is it possible to capture a page content from other website and include in our page dynamically
recorder screen in java
recorder screen in java  Dear friends, how can I capture the screen in real time? best regards Riccardo Susca
recorder screen in java
recorder screen in java  Dear friends, how can I capture the screen in real time? best regards Riccardo Susca
Networking in java - Java Server Faces Questions
Networking in java  I have project named screen capture & controlling..How to use multithreading to connect different clients with server & how to handle
iPhone Capturing Screen SDK
iPhone Capturing Screen SDK  Creating an application to capture the screen shots from iPhone. In objective c is there any class that make it enable..?   UIGraphicsBeginImageContext(CGSizeMake(480,320)); UIImage* result
java
java  Write a Java application that can capture five or more numbers and returns the total of the numbers, the average and the difference between total and average using input dialogs
CAMERA APPLICATION J@ME
CAMERA APPLICATION J@ME  i had written the code to capture image in j2me it is running well on emulator but not running on nokia 6303 if anyone knows please help me at maheshwari1986ashish@gmail.com
scan a image and upload to server
scan a image and upload to server  I have code for capture image and upload to server..after capture that image decoded it going to be convert digit value....My client want to scan a image and upload to server in j2me please
RFT
RFT   Hi I am new to RFT and I am trying to automate an application using it. I need to capture a Number displayed on the screen (e.g 0000000023...). This number is somewhere in between a paragraph, I need to find it and capture
question
question  i have a project for search engine .i have a starting trouble , from where do i start project ,please help me.when i am given a key word to search ,which must return title,summary and url and i want to capture
UISlider action
UISlider action  Hi, How to capture and use UISlider action? Thanks   Hi, Following code might helpful. -(IBAction)changeSlider:(id)sender { NSString *value= [[NSString alloc] initWithFormat:@" Value %d
Hibernate unique key validation example
operation. Or You can capture the exception and process the exception. thanks
How to turn corner of the picture
capture here. Selection: Press Ctrl + A and Crtl + T then right click
How to make a sharpen image
How to make a sharpen image I am going to make a sharp picture effect, I have here a dog picture to modify. Open Picture: Capture a picture to make sharp effect. Effects: Go to Image Menu
what is a Business Analyst?
to understand the business change needs, asses the impact of changes and capture
upload value to php server in getmethod in j2me
upload value to php server in getmethod in j2me  Dear Team, I successfully capture image and decode that image, here i have one doubt after getting that value i means captured decoded value i want to that value in get
embedding cell phone camera inweb page
embedding cell phone camera inweb page  actaully I am working on visitor management project based on jsp ..in home page I want to embed my nokia N73 camera to capture image of visitor, so how do i do this? I tried object tag
JDBC-AWT
JDBC-AWT  I can not able to capture the data in an applet which contains the components like text fields,check box etc.. and i am trying to save the data in sql+. When i run the code in netbeans, i can abe to store successfully
java
java  Using Java, Design a simple interface that can capture information of your choice with the following controls; Labels, Text Fields, Checkbox, Radio buttons and command buttons. You may have to use the following files
UIButton action example
UIButton action example  HI, How i can capture the Button click action? What to write the .h and .m file? Thanks   Hi, Here is the code that you can write in .h file: (void) buttonPress:(id)sender; Here
Detecting Duplicate Keys
can I capture this error code in a Java program
How to make focus on an object, make focus on an object, focus on an object
How to make focus on an object       This example will teach you to make focus on the object so follow step by step this example.... Take a Picture: Capture any picture. Selection
How to design a color in the bucket, design a color in the bucket, color in the bucket
How to design a color in the bucket       Fill color in the blank bucket by taking help of this example. Take a bucket picture: Capture any bucket picture as I have done here
Audio Level Meter
appreciated! public class Capture extends JFrame { protected boolean running; ByteArrayOutputStream out; public Capture() { super("Capture Sound Demo"); setDefaultCloseOperation(EXIT_ON_CLOSE
Network Security Toolkit 1.4.0 is available is now
management; network packet capture - an enhanced NST web-based front-end to the Tethereal network protocol analyzer; network packet capture manager - provides a means to manage network packet capture files on a NST probe; an enhanced NST web
How to design a bouncing cricket ball, design a bouncing cricket ball, cricket ball
a cricket ball. Capture a ball: Capture any cricket ball picture and set
 

 

 

DMCA.com