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

 
 


Sayali Kulkarni
find out in servlet which button was clicked on an html page
1 Answer(s)      a year and a month 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.

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 Pages:
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
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
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
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
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
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/JavaScript code - JSP-Servlet
-- ${row.id} --JSP2-- which has the return button and action leads... to the corresponding page and highlight the corresponding row that was clicked...Html/JavaScript code  I have 2 JSPs JSP1 and JSP2. 1.in JSP1 i
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
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 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
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
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
javascript-html - JSP-Servlet
javascript-html  i want to dynamically create textfield with option button as another/remove when user presses in jsp page which will be in table.for example table contains one row with 2 columns,one textfield,second dropdown
javascript-html - JSP-Servlet
javascript-html  i want to dynamically create textfield with option button as another/remove when user presses in jsp page which will be in table.for example table contains one row with 2 columns,one textfield,second dropdown
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
HTML Get Radio Button
HTML Get Radio Button     ... in URL. Understand with Example The Tutorial illustrates an HTML Get Radio Button example. In this Tutorial we create a radio button, which allows the user to select
Page object - JSP-Servlet
Page object  Hello friends, How can we make use of PAGE object of implicit JSP object. If this is possible explain me about it's methods. I did not find any methods or explanation of this object. Pls help me
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
JSP Back Button
to the page from which they just come from. Understand with Example The Tutorial... and displayed in text area. The Back button takes the user back to the page they just... JSP Back Button   
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
JSP Hindi Page - JSP-Servlet
JSP Hindi Page  I need to provide users with option to print a Certificate in English or Hindi. This is an html page generated by JSP Code. Depending upon the button clicked english or hindi version of the Certificate should
HTML
Markup Language. Using HTML we can create a Web Page which can be viewed... Button in HTML are type of input form, which allows a user to select any one... a radio button in html page.   Cascading Style
create a button in html
create a button in html  How do I create a button which acts like a link
How to add two calendars on the same html page
on same html page it doesn't work..The first calendar works but the second... the id..But i was unable to do find which id needs to be changed in this code...How to add two calendars on the same html page  I have used the same
Radio Buttons in HTML
Radio Buttons in HTML       The Radio Button in HTML are type of input form, which allows...; html page, when it is clicked. The  Output result is sent to the specified
PHP HTML Form Submit Button
Topic : HTML FORM SUBMIT BUTTON Part - 4 The another part which is important... will ask in which it should be sent to the other page. The Submit button in Html is used to submit form data to the page mentioned in the ACTION attribute
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
Button with Image
toolbar...lets find out the steps. Steps of adding image on Button into iPhone... open XIB file and then open interface builder and select button on which you...Button with iPhone Image In the given Iphone SDK tutorial, we are creating
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
servlet
servlet file which prints out the user's inputs. I need to use the post method to pass the data from html to the java servlet and also use both doGet... create a html file that contains four text boxes, first and last name, address
html - JSP-Servlet
html  Hi, I need help with a code to make the "browse" button open in a specific folder, like My Documents/My Images. I've looked everywhere and I can't seem to find
Displaying image when clicked on URL in jsp - JSP-Servlet
*.jpg images displayed depending upon the page url clicked. Please guide me...Displaying image when clicked on URL in jsp  Hi, I am using... For Screenshot : abc.jpg here abc.jpg is a url and when clicked would show me an image
html
html  how we can give the form actions in html after register button in the login page
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
radio button in jsp - JSP-Servlet
radio button in jsp  hye there.how do I create radio button in jsp?Could you please gimme an example of shopping cart in jsp which have I have using... the "Shopping cart application" which is open source. http://www.roseindia.net
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
save links clicked in search engine results
save links clicked in search engine results  hello i need to access...,if i click on a link.i also need to save the clicked link to a database or file.i found how to access the search page of search engines(yahoo) from javascript
submit button
appache tomcat. Check out the jsp servlet Directory Structure... using hibernate in JSP(Netbeans). When I click insert button it should go...; <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Error 500-Server are not find the jar file in the program of upload the file - JSP-Servlet
: 1. Retry the web page by clicking the refresh/reload button or trying...Error 500-Server are not find the jar file in the program of upload..., the server error may only be temporary. Trying the page again will often
Passing Parameter Using Html Form
to display the name on the browser which we have entered from the Html page.  To get the desired result firstly we have to make one html form which... which will work as a controller here picks the value from the html page by using
JSP:HTML Form in-place Editing - JSP-Servlet
to be able to open a page instead of a window for the editing which opens... but not completely. It will highlight the rows but the editing page comes out empty... to achieve is - user fills out a form on one page. On the SAME page
html
html  For what is used HTML?   Using HTML we can create a Web Page which can be viewed through a Web Browser over Internet. HTML describes the contents of a web page with Markup Tags. Tags are defined by angle brackets
Radio button validation using jsp - JSP-Servlet
Radio button validation using jsp  I had one jsp Page and servlet. I did my validations in servlet for my jsp page which contains the radio buttons.Here,the servlet acts as controller and if there is any null(i.e., not choosen
JSP,JDBC and HTML(Very Urgent) - JSP-Servlet
details from database using JDBC and JSP. The home page i.e HTML Page must contain... the code: I am not using any html. I used only jsp & jdbc. HOme Page...JSP,JDBC and HTML(Very Urgent)  Respected Sir/Madam, Thanks
Html
:48:44 PM Author : SAMSUNG --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...; <head> <meta http-equiv="Content-Type" content="text/html
Html
:48:44 PM Author : SAMSUNG --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...; <head> <meta http-equiv="Content-Type" content="text/html
Button in Flex4
any actioin, it uses event listeners. As soon as the button control is clicked...Button in Flex 4: The rectangular button is usually used by the Button component in Flex 4 which looks like to be  suppressed. The text label
HTML-JAVASCRIPT
HTML-JAVASCRIPT  There are two radio buttons. On clicking a radio button, a text area must be created. If a first radio button is clicked, a text area is created. When the second button is clickHTed, a new text area must

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.