capture

Ads

 
 

Share on Google+Share on Google+

Shruti Bansal
capture
1 Answer(s)      5 years and 11 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...!

Ads
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:

<[email protected] 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);
}
%>

Ads









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
Lytro Light Field Camera, a Breakthrough Camera with Unmatched Editing Possibilities
and then can adjust the focus and take different snaps from the same capture.... These microlenses capture multiple attributes of the object including the direction... concept of 'capture first, focus later' technology obviously deserves a lot more
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
Tutorials   
Java Spring Hibernate Struts Training How to Word-wrap in an HTML table? I'm trying to pass counter data to another HTML page. How to display button as a link in vaadin? hi change navbar dropdown color in bootstrap How to remove the background color of bootstrap menu bar? How to change color of opened Bootstrap drop down toggle? Setting bootstrap container background color Help school all activities and admision process.. add one row after another date make a webpage HTMl HTMl Source code how to apply globalisation to a world wide asp.net application how to print HTML using javascript or Jquery How to recover from google panda update? How to survive google panda 4.0 update How to find if you have been hit by Panda 4.0 Design a web page using XHTML and JavaScript that does the followings: ffmpeg converting file mp4 to mov JavaScript How to Disable Catch-all Emails on CPanel z-index always on top What is Web hosting Database and HTML web development trainee Uploading files Image Gallery Image Gallery dropdown How to redirect from a HTML page? Easiest method for expiring the css and js headers HTML WITH AJAX VB 6 Read Web Page Header string palindrom using vbscript? html button How to add mod_deflate to apache without recompiling How to use place hoder in IE(version : 8) Html Software Question div align left css Fetching data from excel file on other website and display in interactive graph form where do I find the fix for tree view catalog not expanding and collapsing correctly for roseindia shopping cart 1.1 pass to next page to enter into a particular page only if the username,password and listbox value mtches hi Cricket stadium ticket booking design Need some help creating an order form.

Ads

 
Advertisement null

Ads