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



Home Answers Viewqa Java-Beginners find out in servlet which button was clicked on an html page
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Sayali Kulkarni
find out in servlet which button was clicked on an html page
1 Answer(s)      2 years and 5 months ago
Posted in : Java Beginners


i have two buttons on my jsp page... and i want two call two seperate codes in a servlet on pressing of those 2 buttons.. how do i find out which button was clicked so as to call that respective method.


Advertisement
View Answers

April 9, 2012 at 4:36 PM


<html>
<head>
<SCRIPT>
function submitFunction(i) {
if (i=='Roseindia') document.theForm.action="http://www.roseindia.net";;
if (i=='Newstrackindia') document.theForm.action="http://www.newstrackindia.com";;
if (i=='Javajazzup') document.theForm.action="http://www.javajazzup.com";;
document.theForm.submit()
}
</SCRIPT>
</head>
<body>
<h1>Multiple Buttons Example</h1>
<FORM NAME="theForm">
<INPUT TYPE="button" VALUE="Roseindia" onClick="submitFunction('Roseindia')">
<INPUT TYPE="button" VALUE="Newstrackindia" onClick="submitFunction('Newstrackindia')">
<INPUT TYPE="button" VALUE="Javajazzup" onClick="submitFunction('Javajazzup')">
</FORM>

</body>
</html>

For more information, visit the following link:

http://www.roseindia.net/servlets/web-application.shtml



Related Tutorials/Questions & Answers:
find out in servlet which button was clicked on an html page
find out in servlet which button was clicked on an html page  i have two buttons on my jsp page... and i want two call two seperate codes in a servlet on pressing of those 2 buttons.. how do i find out which button was clicked so
Find currenly which field is having focus on html page? - Ajax
Find currenly which field is having focus on html page?  Hi All... in Category. My problem is I have two form on single html page with two different... don't know which form user want's to be submit. So I am trying to get which field
Advertisements
extract data fom table when a button is clicked in front end page using mysql5.0 and tomcat6.0
extract data fom table when a button is clicked in front end page using mysql5.0 and tomcat6.0   sir, i want to extract data from table which is stored in mysql5.0 databse, when a button is clicked in front end page using
get a value when a radio button clicked - JSP-Servlet
get a value when a radio button clicked  sorry sir my actual probs... button to access a value(also used u r code),then in this jsp i m having a forms to call a servlet,then in a servlet i m using a switch case to call a jsps
get a value when a radio button clicked - JSP-Servlet
get a value when a radio button clicked  Here is my code sir please...(servlet) package com.antares.servlet...(); response.setContentType("text/html"); String strAct = request.getParameter
Save the content in my wysiwyg editor into specified location of user when clicked on save button in my web page
Save the content in my wysiwyg editor into specified location of user when clicked on save button in my web page  I am using wysiwyg editor to display some static content.My requirement is that This static content can be edited
Login Box appears when a button on the webpage is clicked
Login Box appears when a button on the webpage is clicked  How to create a Login Box on a web page that appears only when a button that is already present on the page is clicked
Login Box appears when a button on the webpage is clicked
Login Box appears when a button on the webpage is clicked  How to create a Login Box on a web page that appears only when a button that is already present on the page is clicked
Login Box appears when a button on the webpage is clicked
Login Box appears when a button on the webpage is clicked  How to create a Login Box on a web page that appears only when a button that is already present on the page is clicked
HTML Button Size
HTML Button Size       Button in HTML is used to submit HTML page. Understand with Example... create a HTML page, which display you  HTML Button  with  attribute
Which request executed first Out of multiple requests in servlet
Which request executed first Out of multiple requests in servlet  Servlet handles multiple request simultaneously.Every new request will be assigned... to servlet ,which request will be executed first , please correct me if question
How to pass parametes from JSP page to HTML page? - JSP-Servlet
with the username in HTML which I have called in JSP page. So I just want to pass the values from my JSP page to HTML page. Pls help me out. Hitendra ...How to pass parametes from JSP page to HTML page?  Hi all, In my
html button
html button  when i click the submit button the entered data will be displayed below the submit button please help me
Button Size HTML
HTML Button Size can be changed according to programmer use. HTML button submits HTML page. In the following example we will learn how to change the size of a HTML button. First we create a HTML page. Then we display a HTML Button
how to execute the below servlet with html page
how to execute the below servlet with html page  //vallidate user n...,ServletException { res.setContentType("text/html"); PrintWriter out=res.getWriter...(); response.setContentType("text/html"); PrintWriter out=response.getWriter(); pw.println
Find focus of the keyboard cursor when ctrl+f is clicked in swing
Find focus of the keyboard cursor when ctrl+f is clicked in swing  Hi, I have created one small swing applications with two textarea. I want... somebody please tell me ..How to find a component which had the focus
Find out last character of array
Find out last character of array  How we can find out the last character of array in java program
how to remove spell check in flex when button is clicked
how to remove spell check in flex when button is clicked  how to remove spell check when button is clicked in rich text editor control
Using a image for Browse button instead of normal html Browse button for Uploading files from a JSP - JSP-Servlet
Using a image for Browse button instead of normal html Browse button... a Upload button, when I upload the file selected, it gives me errors. Is it not possible to use a image instead of normal html Browse button for uploading files
Struts + HTML:Button not workin - Struts
Struts + HTML:Button not workin  Hi, I am new to struts. So pls... ----------- System.out.println(searchForm.get_button_Clicked()); The above statement displays "null"; I have defined button_clicked in bean class. I thought when i
Find out the prime number
Find out the prime number      ... to find out whether a given number is prime or not. Here we have used the 'for loop...;} } Download this page
Refresh Button returns null point exception when clicked
Refresh Button returns null point exception when clicked  Dear all Please assist with the following: How to rectify a piece of code for the refresh button in java. When clicking the button it returns an error "null point
how to call servlet from html page at anchor tag ?
how to call servlet from html page at anchor tag ?  I have a very... to other page and at that place i give url of a servlet but in server that url... it is not working properly. I split and merge template. In the header part of my page i use
jsp :how to edit table of data displayed using jsp when clicked on edit button
the data when clicked on save button.. how can i do...jsp :how to edit table of data displayed using jsp when clicked on edit button  i have a jsp program which displays data in the form of table ..now i
regarding out put display in html text field
regarding out put display in html text field  how to dispaly the output coming from servlet in a particular text field of html
create a button in html
create a button in html  How do I create a button which acts like a link
facebook login button html
facebook login button html  facebook login button html i have a facebook login button code ..but not sure how to use it. Can any one please explain? Here is the facebook login button code in html <fb:login-button
jsp :how to edit table of data displayed using jsp when clicked on edit button
want to edit this information in table when clicked on edit button and save the data when clicked on save button.. how can i do this   The given..., there is a button which consists of that particular id. When the user clicks
calling java method from html form with out using javascript - JSP-Servlet
calling java method from html form with out using javascript  How can i call java method from a HTML form, java script should be disabled?  Hi <html><head><title>Test Input Validation</title><
Calendar window is not coming for the Dynamic rows in html page - JSP-Servlet
Calendar window is not coming for the Dynamic rows in html page  Calendar window is not coming for the Dynamic rows in html page. I have 3 textboxes. one column is having the date textbox .I need to add the calendar icon
Write an applet that prints "Lear Java it is useful" at the current cursor position whenever the mouse left button is clicked.
Write an applet that prints "Lear Java it is useful" at the current cursor position whenever the mouse left button is clicked.   Write an applet... the mouse left button is clicked
 

 

 

DMCA.com