capture

Ads
 

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 reply soon...!

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);
}
%>

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
ModuleNotFoundError: No module named 'capture'
ModuleNotFoundError: No module named 'capture'  Hi, My Python... 'capture' How to remove the ModuleNotFoundError: No module named 'capture... to install padas library. You can install capture python with following command
ModuleNotFoundError: No module named 'capture'
ModuleNotFoundError: No module named 'capture'  Hi, My Python... 'capture' How to remove the ModuleNotFoundError: No module named 'capture... to install padas library. You can install capture python with following command
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
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
ModuleNotFoundError: No module named 'capture-assembler'
ModuleNotFoundError: No module named 'capture-assembler'  Hi, My... named 'capture-assembler' How to remove the ModuleNotFoundError: No module named 'capture-assembler' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'capture-me'
ModuleNotFoundError: No module named 'capture-me'  Hi, My Python... 'capture-me' How to remove the ModuleNotFoundError: No module named 'capture-me' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'fer-capture'
ModuleNotFoundError: No module named 'fer-capture'  Hi, My Python... 'fer-capture' How to remove the ModuleNotFoundError: No module named 'fer-capture' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'gripit-capture'
ModuleNotFoundError: No module named 'gripit-capture'  Hi, My... named 'gripit-capture' How to remove the ModuleNotFoundError: No module named 'gripit-capture' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'link_capture'
ModuleNotFoundError: No module named 'link_capture'  Hi, My Python... 'link_capture' How to remove the ModuleNotFoundError: No module named 'link_capture' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'quartet_capture'
ModuleNotFoundError: No module named 'quartet_capture'  Hi, My... named 'quartet_capture' How to remove the ModuleNotFoundError: No module named 'quartet_capture' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'todoist-capture'
ModuleNotFoundError: No module named 'todoist-capture'  Hi, My... named 'todoist-capture' How to remove the ModuleNotFoundError: No module named 'todoist-capture' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'trello-capture'
ModuleNotFoundError: No module named 'trello-capture'  Hi, My... named 'trello-capture' How to remove the ModuleNotFoundError: No module named 'trello-capture' error? Thanks   Hi, In your python
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
ModuleNotFoundError: No module named 'django-capture-tag'
ModuleNotFoundError: No module named 'django-capture-tag'  Hi, My... named 'django-capture-tag' How to remove the ModuleNotFoundError: No module named 'django-capture-tag' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-capture-tag'
ModuleNotFoundError: No module named 'django-capture-tag'  Hi, My... named 'django-capture-tag' How to remove the ModuleNotFoundError: No module named 'django-capture-tag' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'docker-netowrk-capture'
ModuleNotFoundError: No module named 'docker-netowrk-capture'  Hi...: No module named 'docker-netowrk-capture' How to remove the ModuleNotFoundError: No module named 'docker-netowrk-capture' error? Thanks   Hi
ModuleNotFoundError: No module named 'docker-network-capture'
ModuleNotFoundError: No module named 'docker-network-capture'  Hi...: No module named 'docker-network-capture' How to remove the ModuleNotFoundError: No module named 'docker-network-capture' error? Thanks   Hi
ModuleNotFoundError: No module named 'docker-netowrk-capture'
ModuleNotFoundError: No module named 'docker-netowrk-capture'  Hi...: No module named 'docker-netowrk-capture' How to remove the ModuleNotFoundError: No module named 'docker-netowrk-capture' error? Thanks   Hi
ModuleNotFoundError: No module named 'docker-network-capture'
ModuleNotFoundError: No module named 'docker-network-capture'  Hi...: No module named 'docker-network-capture' How to remove the ModuleNotFoundError: No module named 'docker-network-capture' error? Thanks   Hi
ModuleNotFoundError: No module named 'jupyterlab-media-capture'
ModuleNotFoundError: No module named 'jupyterlab-media-capture'  Hi...: No module named 'jupyterlab-media-capture' How to remove the ModuleNotFoundError: No module named 'jupyterlab-media-capture' error? Thanks  
ModuleNotFoundError: No module named 'mac-copy-capture'
ModuleNotFoundError: No module named 'mac-copy-capture'  Hi, My... named 'mac-copy-capture' How to remove the ModuleNotFoundError: No module named 'mac-copy-capture' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'nionswift-video-capture'
ModuleNotFoundError: No module named 'nionswift-video-capture'  Hi...: No module named 'nionswift-video-capture' How to remove the ModuleNotFoundError: No module named 'nionswift-video-capture' error? Thanks   
ModuleNotFoundError: No module named 'pi-camera-capture'
ModuleNotFoundError: No module named 'pi-camera-capture'  Hi, My... named 'pi-camera-capture' How to remove the ModuleNotFoundError: No module named 'pi-camera-capture' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'pi-camera-capture'
ModuleNotFoundError: No module named 'pi-camera-capture'  Hi, My... named 'pi-camera-capture' How to remove the ModuleNotFoundError: No module named 'pi-camera-capture' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'pytest-capture-deprecatedwarnings'
ModuleNotFoundError: No module named 'pytest-capture-deprecatedwarnings' ...: ModuleNotFoundError: No module named 'pytest-capture-deprecatedwarnings' How to remove the ModuleNotFoundError: No module named 'pytest-capture-deprecatedwarnings'
ModuleNotFoundError: No module named 'rpi-mail-cam-capture'
ModuleNotFoundError: No module named 'rpi-mail-cam-capture'  Hi...: No module named 'rpi-mail-cam-capture' How to remove the ModuleNotFoundError: No module named 'rpi-mail-cam-capture' error? Thanks   Hi
ModuleNotFoundError: No module named 'scapy-nflog-capture'
ModuleNotFoundError: No module named 'scapy-nflog-capture'  Hi, My... named 'scapy-nflog-capture' How to remove the ModuleNotFoundError: No module named 'scapy-nflog-capture' error? Thanks   Hi
ModuleNotFoundError: No module named 'scapy-nflog-capture'
ModuleNotFoundError: No module named 'scapy-nflog-capture'  Hi, My... named 'scapy-nflog-capture' How to remove the ModuleNotFoundError: No module named 'scapy-nflog-capture' error? Thanks   Hi

Ads