create a button

create a button

i have created button inhtml but my jsp is not working,so can u guide me

View Answers

February 10, 2012 at 11:51 AM

1)form.html:

<html>
<form method="post" action="http://localhost:8080/examples/jsp/insert.jsp">
<table>
<tr><td>First Name:</td><td><input type="text" name="fname"></td></tr>
<tr><td>Last Name:</td><td><input type="text" name="lname"></td></tr>
<tr><td>Email:</td><td><input type="text" name="email"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
<tr><td>Confirm Password:</td><td><input type="password" name="cpass"></td></tr>
<tr><td>Date Of Birth</td><td><input type="text" name="dob"></td></tr>
<tr><td>Age:</td><td><input type="text" name="age"></td></tr>
<tr><td>Gender</td><td><input type="text" name="gender"></td></tr>
<tr><td>Address:</td><td><input type="text" name="address"></td></tr>
<tr><td>Country</td><td><input type="text" name="country"></td></tr>
<tr><td>State:</td><td><input type="text" name="state"></td></tr>
<tr><td>City</td><td><input type="text" name="city"></td></tr>
<tr><td>Telephone No:</td><td><input type="text" name="tno"></td></tr>
<tr><td>Mobile:</td><td><input type="text" name="mobile"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

2)insert.jsp:

<%@page import="java.sql.*,java.util.*"%>
<%
String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String email=request.getParameter("email");
String pass=request.getParameter("pass");
String cpass=request.getParameter("cpass");
String dob=request.getParameter("dob");
int age=Integer.parseInt(request.getParameter("age"));
String gender=request.getParameter("gender");
String address=request.getParameter("address");
String country=request.getParameter("country");
String state=request.getParameter("state");
String city=request.getParameter("city");
int telephone=Integer.parseInt(request.getParameter("tno"));
int mobile=Integer.parseInt(request.getParameter("mobile"));
        try{
         Class.forName("com.mysql.jdbc.Driver");
           Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/roseindia", "root", "root");
           Statement st=con.createStatement();
           int i=st.executeUpdate("insert into student(firstname,lastname,email,pass,confirm_pass,dob,age,gender,address,country,state,city,telephone,mobile) values('"+fname+"','"+lname+"','"+email+"','"+pass+"','"+cpass+"','"+dob+"',"+age+",'"+gender+"','"+address+"','"+country+"','"+state+"','"+city+"',"+telephone+","+mobile+")");
        out.println("Data is successfully inserted!");
        }
        catch(Exception e){
        System.out.print(e);
        e.printStackTrace();
        }
        %>









Related Tutorials/Questions & Answers:
create a button
create a button  i have created button inhtml but my jsp is not working,so can u guide me
create a button in html
create a button in html  How do I create a button which acts like a link
Advertisements
Create Button in CSS
Create Button in CSS  Can anyone help me to create a button in CSS HTML
How to Create Button With TableView in iphone
How to Create Button With TableView in iphone  My requirement is i am creating one button. when i press the button TableView will display... on the button can u please send me the code i want to create converter app. thanks
How create an overlay button on different containing div
How create an overlay button on different containing div  How to create an overlay button on different containing div
Create Round Button in Java swing
Create Round Button in Java swing In this tutorial, we are going to create a button of round shape. Java2D APIs and Java Swing make it easy to implement...); } public static void main(String[] args) { JButton button = new
Create a input button inside js function
Create a input button inside js function  I call my js function from HTML code from another file. Now I would like to create a input button on page.... Now I would like to create a input button on page using createElement() in my
How would you create a button with rounded edges?
How would you create a button with rounded edges?   How would you create a button with rounded edges?   Hi, Here is the answer,ADS_TO_REPLACE_1 We can create rounded edge button in two way's, The first thing
How to Create Button on Frame
How to Create Button on Frame       In this section, you will learn how to create Button on ... will show a simple command button labeled with the text "Submit" when
List the names of classes used to create button and text box in Java.
List the names of classes used to create button and text box in Java.  List the names of classes used to create button and text box in Java
Button
Button  How to use image for button in JSF
i want to create an application with only a button which on click displays table from database using struts2 and hibernate on eclipse
i want to create an application with only a button which on click displays table from database using struts2 and hibernate on eclipse  please help me i have to submit this soon
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 submit  Hi, I created a button when i click on button new textbox... will click submit button the text should be submitted(it shows the value in text
Create UIButton Programmatically
and add a button on UIView dynamically. To create a button programmatically just... req. like you can create a simple RoundedRect button or a custom button if need..., we have successfully create a button but to add this button on view we need
button
button  can i give multiple commands on click of a button? if yes how can i do that?? multiple commands can be retriving dat from database, capturing data, moving to next page.. etc
button
button  can i give multiple commands on click of a button? if yes how can i do that?? multiple commands can we retriving dat from database, capturing data, moving to next page.. etc
Radio Button in Java
by the user. The AWT  Widget used to create a radio button is Checkbox. The Checkbox class is used by the AWT to create both Radio Button and Checkbox. There is no Radio Button class.awt to create a RadioButton.In order to create
Create a JRadioButton Component in Java
: This is the class has been used to create a single radio button for the application... Create a JRadioButton Component in Java       In this section, you will learn how to create a radio
create
create  how to create an excel file using java
Java Swing Create LinkButton
are going to create a Link Button that will allow you to move to another page...Java Swing Create LinkButton You all are aware of JButtons, JRadioButtons...()); JButton button = new JButton(); button.setText("www.roseindia.net
Create Radio Buttons in SWT
;    This section illustrates you how to create radio button. In SWT, the style RADIO defined in the Button class allows to create radio button. We have create an array object of Button class. The class Label displays
how can create pop() method in this program ,Or how can delete image in it when i press pop button in runtime ??? please help me ...
how can create pop() method in this program ,Or how can delete image in it when i press pop button in runtime ??? please help me ...   ... the pet images and create an array of indexes. images = new ImageIcon
HTML Button Size
HTML Button Size       Button in HTML is used to submit HTML page. Understand with Example ADS_TO_REPLACE_1 The Tutorial illustrate an example from HTML Button size. In this Tutorial
iPhone Button Click Sound
builder. If you don't know how to create the button then please check... iPhone Button Click Sound In this series of iPhone button tutorial, we are going to create a small iphone application that is going to play a sound
Dojo Radio Button
Dojo Radio Button          In this section, you will learn how to create radio buttons in dojo. For creating radio button you need "dijit.form.CheckBox". The radio
Creating Flex ActionScript Custom Component extending Button
; } Creating Flex ActionScript Custom Component extending Button   ActionScript can be used to create custom components. In the example below,  a custom button component is created by extending Button class.  
iPhone Button Image
iPhone Button Image In this tutorial will learn how to Create iPhone Button... First will create button through which will set image on window when button... into DidFinishLaunching, will create button and also will set the size of button
Radio Button In Java
Radio Button In Java       Introduction In this section, you will learn how to create Radio Button... how to create and show the Checkboxgroup component on the frame. ADS_TO_REPLACE_1
Radio Button in J2ME
to demonstrate, how to create the radio button in J2ME using MIDlet. The radio button is use to choose only one option at a time. To create the radio button we... Radio Button in J2ME      
Dojo NumberSpinner Button
Dojo NumberSpinner Button          In this section, you will learn how to create a NumberSpinner button that increase and decrease the number. Sometime, if you
wnidows button
wnidows button   How to handle windows back and forward button in struts applications, without using java script
facebook like button code
facebook like button code  How to create a facebook like button? can anyone share the code..?? Thanks in advance
Button in Dojo - Framework
Button in Dojo  I want to create button in Dojo, new to dojo  Dojo - creating a button, lets say hello world button using DOJODojo Button Example http://www.javajazzup.com/issue9/page40.shtmlDojo Tutorial Resourceshttp
radio button
radio button  On selecting a radio button, it should open a aspx page
html button
html button  when i click the submit button the entered data will be displayed below the submit button please help me
Swing Button Example
Swing Button Example  Hi, How to create an example of Swing button in Java? Thanks   Hi, Check the example at How to Create Button on Frame?. Thanks
Style in button
Style in button  Hi.... How can I set the button width with fx:style...;Ans: The width of the button will not set by the style because it is the property of the button not the style property of the button.ADS_TO_REPLACE_2 Thanks
coding of button
coding of button  What is code of fetching the value of button in a textbox using javascript
flogin button
flogin button  how to pass redirctt url for flogin button...and to retrieve parameters that are passed in that url..to store in our database
Back button
Back button  how to redirect to a home page when a back button is pressed in jsp instead of displaying the previous page
Print Button
Print Button  i want the source code for printing details of jform.. so plz help me for source code of print button
uikeyboard done button/return button
uikeyboard done button/return button  Hi everyone!!! Just worried about ..how to return the UIKeyboard on done or return button click in my iPhone... to return the uikeyboard on done button click. Do not forget to call <
button tag
button tag  how do i change button color to black. meant to say i want black button with white text on it   Hi Friend, Try the following... Message: <input type="text" id="msg"><br> <input type="button" value
jquery button click
to create a button event in JQuery. You can edit it as per your requirement. In Header...jquery button click  jquery button click - I have created a button...(){ alert("button clicked"); }); }); </script> JQuery HTML
button in java
button in java  how can i compare names of two buttons after...(ActionEvent e) { System.out.println("button clicked"); } } Thanks... a beginner.I'm using simple awt components. i want to keep the labels on the button same
submit button
submit button  <p>hi I am trying to insert record in database using hibernate in JSP(Netbeans). When I click insert button it should go to insert.java class but fails to go.</p> <ul> <li><p>
on click button php
on click button php  Function in PHP for on click button
handling Button Event in iphone
handling Button Event in iphone  handling Button Event in iphone
iPhone Radio Button Example
iPhone Radio Button Example  Can you please suggest me how to create Radio button in my iPhone application. Actually, in my application i have two... click on that button it get selected and by default it should display unselected
jsp continuation button
jsp continuation button  i have 2 jsps, 1st jsp page with continue button and 2nd jsp with submit button.so how do i create a sessionvariable in order to submit the 2jspforms

Ads