Multiple buttons in struts using java script

Multiple buttons in struts using java script

Multiple buttons in struts using java script?

View Answers

November 20, 2010 at 2:47 PM

Hi friends,

This example defines how to create a multiple button in struts using javascript.

JSP Page :

<html:form action="/corporations.do?method=createPage" >
<tr>
            <td>BookID</td>
            <td><html:text property="bookID" size="20"/></td>
        </tr>
        <tr>
            <td>BookName</td>
            <td><html:text property="bookName" size="20"/></td>
        </tr>

<input type="button" value="Save and Continue" name="b1" onClick="save()">
      <input type="button" value="Discard Changes" name="b2" onClick="discard()">
</html:form>

In the Java Script
<script type="text/javascript" >

    function save() {

        document.OrganizationForm.action ="<%=request.getContextPath()%>/corporations.do?method=save";
        document.OrganizationForm.submit();
    }

    function discard() {

        document.OrganizationForm.action ="<%=request.getContextPath()%>/corporations.do?method=discard";
        document.OrganizationForm.submit();
    }
</script>

Thanks.









Related Tutorials/Questions & Answers:
Multiple buttons in struts using java script
Multiple buttons in struts using java script  Multiple buttons in struts using java script
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...="file" name="file[]" multiple/> <html:submit value = "S U B M I T"/>
Advertisements
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...="file" name="file[]" multiple/> <html:submit value = "S U B M I T"/>
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...="file" name="file[]" multiple/> <html:submit value = "S U B M I T"/>
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...="file" name="file[]" multiple/> <html:submit value = "S U B M I T"/>
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...="file" name="file[]" multiple/> <html:submit value = "S U B M I T"/>
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...="file" name="file[]" multiple/> <html:submit value = "S U B M I T"/>
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...="file" name="file[]" multiple/> <html:submit value = "S U B M I T"/>
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...="file" name="file[]" multiple/> <html:submit value = "S U B M I T"/>
How to upload multiple images in java(struts) using jsp?
How to upload multiple images in java(struts) using jsp?  I have jsp... to upload the multiple images in struts Total images storing folder in project...="file" name="file[]" multiple/> <html:submit value = "S U B M I T"/>
uinavigationcontroller add multiple buttons
uinavigationcontroller add multiple buttons  How to add multiple buttons to the UINavigationController
how insert multiple images in mysql database with use of struts 1.3.8 or java method, with single bean,or using array
how insert multiple images in mysql database with use of struts 1.3.8 or java... ,with struts 1.3.8 and i want to insert multiple images in mysql database ,with use of struts 1.3.8 ,or with the help of Array methods ,like google multiple
how to store multiple values from drop down in database where i am using java struts 1.3
how to store multiple values from drop down in database where i am using java struts 1.3  hii, i am coding a form where i need a keyskills attribute... is displaying.. i need code in java so that it takes multiple values
java script - Struts
java script  how validation for date is performed in the top-down select.if the user clicks submit without selecting the date, month and year. what is the validation for selecting a date that is in future like jul 2009
Handling multiple buttons in HTML Form
Handling multiple buttons in HTML Form  How to handle Handling multiple buttons in HTML Form
Multiple submit buttons in single xhtml form - Java Server Faces Questions
Multiple submit buttons in single xhtml form  Hi all, Here I am attaching the source of the page , which containig two submit buttons. Somebody suggested to keep eaxh button in different form. I am new to JSF, can anyone split
form values in java script - Struts
form values in java script  how to get form values in java script functions with struts1.1
multiple browsers in java script - JSP-Servlet
multiple browsers in java script  How to make my jsp browser specific?  Hi friend, For solving the problem visit to : http://www.roseindia.net/jsp/simple-jsp-example/JSPPlugins.shtml Thanks
barcode reader using java script
barcode reader using java script  Hai all, I need code for one application in java and java script my requirement is, Scanning data directly into a field is the easiest of all implementations. The cursor is placed
Create Multiple Buttons
Create Multiple Buttons using Java Swing       In this section, you will learn how to create multiple... have created an array of letters. Using this array, we have labeled the buttons
Without Using Form in Java Script
Without Using Form in Java Script  HOw to Reset the data in javascript without using form tag
Display Multiple Images in jscrollpane using Java Jpanel
Display Multiple Images in jscrollpane using Java Jpanel  Browse and Display multiple images in vertical view of java jscrollpane using jpanel
multiple selections list in Struts
multiple selections list in Struts  How to create a multiple selections list in Struts? and retrive seleted values
Storing Multiple image in sql using java
Storing Multiple image in sql using java  Hi, How to store and retrieve a multiple image in sql using java but already i have created sql table if i want to insert a image while runtime execution. Can anyone tell me solution
Multiple inheritance using interface - Java Beginners
Multiple inheritance using interface  Hi, I understand.... But the use of the interface is when we use multiple inheritance with more than one... in multiple inheritance Thank you, Rajkanth  Hi Friend, Please
Multiple file upload - Struts
Multiple file upload  HI all, I m trying to upload multiple files using struts and jsp. I m using enctype="multipart". and the number of files... only with servlets and i m using struts. I have this implemeted in servlets
multiple configurstion file in struts - Struts
multiple configurstion file in struts  Hi, Please tell me the solution. I have three configuration file as 'struts-config.xml','struts-module.xml' and 'struts-comp.xml'.I have three jsp pages as 'index1.jsp','index2.jsp
Hit Counter Schema using java script - WebSevices
Hit Counter Schema using java script   Dear Sir, I am sending you none project i need you help please tell me how to do it? first I have... the cookie by using a random sessionID. for that I have to use a page
Merge multiple jasper file to one word Doc using java
Merge multiple jasper file to one word Doc using java   how to Merge multiple jasper file to one word Doc using java
using captcha with Struts - Struts
using captcha with Struts  Hello everybody: I'm developping a web application using Struts framework, and i would like to use captcha  Hi friend,Java Captcha in Struts 2 Application :http://www.roseindia.net
how can i achieve multiple inheritance in java without using inheritance ?
how can i achieve multiple inheritance in java without using inheritance ?  how can i achieve multiple inheritance in java without using inheritance
Hide buttons in Java Swing
Hide buttons in Java Swing In this section, you will learn how to hide buttons using java swing. For this, we have created three buttons, A, B and C. We have performed an action on C. When you click the button 'C', buttons A and B
how to upload and download images using buttons in jsp?
how to upload and download images using buttons in jsp?  how to upload and download images using buttons in jsp
how can clear the browser cache memory using java script
how can clear the browser cache memory using java script  how can clear the browser cache memory using java script
Internationalization using struts - Struts
Internationalization using struts   Hi, I want to develop a web application in Hindi language using Struts. I have an small idea... to convert hindi characters into suitable types for struts. I struck here please
How to create Multiple Frames using Java Swing
Multiple Frames in Java Swing In this section, you will learn how to create multiple frames. Java Swing provides the utility to show frame within another... JFrame("Multiple Frames"); frame.setDefaultCloseOperation(JFrame.EXIT
Browser Back Button Disable/Hide/Invisible using Java Script
Browser Back Button Disable/Hide/Invisible using Java Script  Dear Sir, Please Help..., Q: How to Write Code For Browser Back Button Disable/Hide/Invisible using Java Script without Page Reload/Refreshing. anyone
WRITE A CODE IN STRUTS ACTION CLASS FOR CHECK BOXES AND RADIO BUTTONS - Struts
WRITE A CODE IN STRUTS ACTION CLASS FOR CHECK BOXES AND RADIO BUTTONS ... esteemed and talented people.iwould like to write code in struts action class for check boxes and radio buttons and for submit buttons. i have a jsp page which
Using criteria for multiple tables
Using criteria for multiple tables  How to join more than three tables,those tables must be maintain primary key relation ship using Hql criteria & projections
Using criteria for multiple tables
Using criteria for multiple tables  How to join more than three tables,those tables must be maintain primary key relation ship using Hql criteria & projections
reading data using struts and jsp java
reading data using struts and jsp java  how can i read data entered by user into a textbox (jsp page) into struts action class ex emp id,so that after reading emp_id it can be read into struts action class for retrieving other
multiple JComboBoxes using with JDBC
multiple JComboBoxes using with JDBC  how to use JComboBoxes with JDBC in java  Hi Friend,Try the following code:import java.awt.*;import...(){JFrame f = new JFrame("Frame in Java Swing");JLabel label1=new
Java script
Java script  Source code for capturing the screen using Java Script
Java Script
Java Script  why we are using java script
remove item from list box using java script - Java Beginners
remove item from list box using java script  remove item from list box using java script  Hi friend, Code to remove list box item using java script : Add or Remove Options in Javascript function addItem
Using java script do login form having fields with condition.
Using java script do login form having fields with condition.  Need a login form with username, password, phone no, email id, date fields. We should specify the conditions for each field and if we press the submit button
delete multiple row using checkbox
delete multiple row using checkbox  how to delete multiple row in a table which is connected to database using checkbox
delete multiple row using checkbox
delete multiple row using checkbox  how to delete multiple row in a table which is connected to database using checkbox
Java Script
Java Script  Hi, Any one please share a code to swap the 2strings using java script
Is Multiple Actions in Action class - Struts
Is Multiple Actions in Action class  In ActionClass we can use only one action i.e execute(), but in DispatchAction we can use multiple actions.My question is , we can use multiple actions in Action class if(action.equals("add

Ads