Use two actions in one form

I want to use two actions in one form in struts,and without using javascript,is it possible?

I want to use two submit:
one is for adding message;
another is for editing message.
they must be in one form,but i dont know how to use
two actions in one formHi,
Hope this helps.
cheers,
jeric
<html>
<head>
<title>decision</title>
</head>
<body>
<br><br><br>
<center><h3><u>Two submits, one form</u></h3></center>
<%
String userChoice = request.getParameter("decision");
if( userChoice != null && userChoice.equals("add") == true)
    // forward to addMessage.jsp, for example, or whatever
else
if( userChoice != null && userChoice.equals("edit") == true)
     // forward to EditMessage.jsp, for example, or whatever
out.println( "<br><center> the value of userChoice after selection is ... " + userChoice + "</center><br>");
%>
<center>
<form method="post" action ="decision.jsp"> <!-- name of this page -->
    <table width = "50%" align="center">
         <tr><td width = "100%"><hr color ="red" ></td></tr>
          <tr><td height = "10"></td></tr>
         <tr><td align = "center">Do you want to <b>add</b> a message or <b>edit</b> a message?</td></tr>
         <tr><td height = "10"></td></tr>
         <tr><td align = "center">
              <input name = "decision" type = "radio"  value = add checked>?add a message??
              <input name = "decision" type = "radio" value = edit>?edit a message?
         </td></tr>
    </table>
    <br>
    <input type="submit"  value = " make your selection " >
</form>
<hr color ="red" width = "50%">
</center>
</body>
</html>

Similar Messages

  • Can we perform two actions with one button with two clicks one after other?

    Sir,
    can we perform two actions with one button with two clicks one after other?
    I want that when I click an Add Button first time it add data to the database and when I click again this button it clear the form data to empty fields.
    Regards
    Tanvir

    In code it should be easy.
    The following code adds a button called butman with a text "ADD".
    It then registers a listener that will be called if the button is clicked.
    This listener then calls the runAddData method if you clicked on butman while it contained the "ADD" text and it will call the runClearData method otherwise.
    Therefore it will swap the button's functionality between ADD and CLEAR on every click.
    final Button butman = new Button("ADD");
    butman.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent t) {
                        if (butman.getText().equals("ADD")) {
                                  butman.setText("CLEAR");
                                  runAddData();
                        } else {
                                  butman.setText("ADD");
                                  runClearData();
                        } // END IF-THEN
              }});I hope this is what you wanted.
    Some extra food for thought.
    You might want to run the ADD and CLEAR methods in their own threads so that it can run in the back ground, without slowing down your user interface.
    I also like to rather reuse one button for multiple functionality in stead of making an application with hundreds of nodes only used rarely with masses of code to show and hide them if needed.

  • HELLP!! NEED TO KNOW HOW TO USE TWO IPODS ON ONE COMP!ASAP

    i have an ipod nano and an itunes account. Now my mom has a nano and we need to know if you can register them on the same account and how or any other tips for using two ipods on one comp!
    PLEASE HELP ASAP!
    ZACH

    Hello Zach,
    There are a couple of methods for using more than one iPod on a single computer. Have a look at the article linked below. Method one is to have two Mac or Windows user accounts which by definition would give you two completely separate libraries. Method two is to set your preferences so each iPod is updated with only certain playlists within one library. Have a look anyway and see what you think and go for whichever you feel suits your needs best: How To Use Multiple iPods with One Computer

  • Two layouts in One form

    Hi,
    I want to create two layouts in one form. how can we create that.
    Thanks in Advance.
    Regards,
    Ramana

    Hi all,
    I have one requirement. I have created a form for Medruck and assigned it in nace tcode for purchase order. My requirement is if version number is ' 0 ' one page should be called and if version number is not zero another page layout should be called. I have created 2 different page layouts in my SAP Script i.e. one page named first layout and second named other layout. if version number is 0 first layout should be called and version number ne 0 other layout page should be called. Is it possible to do it? if so, how shall i do this...
    Kindly help me...
    Thanks and regards,
    subbu.

  • Using two templates on one site.

    Im trying to design a website, and due to my lack of experience i have gone down the template route. I have download two adobe muse templates. i am designing my website on one of them (so this is a site) i want to use the second template as a new page for my current website how can i do this?  Thanks. if I've over complicated things, in short how can i use two templates in one site as two separate pages.

    Hi,
    You can setup two different master page, each with a template. See if that works.
    If you are not already aware of Master page, please have a look to this.
    Understanding master pages | Adobe Muse CC tutorials
    Do let me know if you have any question.

  • How can I use two Ipods on one computer.

    I was wondering if it is possible to use 2 Ipods on one computer without having to reload all of the music to the new library.

    If you are adding a second iPod for your own use, just connect the new iPod to your computer and follow the on screen instructions. It will update from your existing library. Depending on the size of your library and the type of iPod you choose you can have it update all songs and playlists, selected playlists only or you can manage it manually
    If the iPods belong to different users then there are actually a few methods for using more than one iPod on a single computer: How To Use Multiple iPods with One Computer
    Just to summarise what's in the link above which is a little out of date:
    Method one is to have individual Mac or Windows user accounts which by definition would give you completely separate iTunes Music folders and libraries.
    Method two is to set your preferences so that any or all of iPods get updated with only certain playlists within one library:
    Loading songs onto iPod automatically - Windows
    Choosing the update option "Sync Music - Selected playlists" allows you to create a playlist specifically for each iPod and drag the tracks you want into it. If you tire of the list and want to change it, you just add or remove the songs you don't want. The ones you take out out remain in the library to be used by the other iPod. You can read more about playlists at these links:
    iTunes: Creating playlists of your favorite songs
    How to create a Smart Playlist with iTunes
    Another option when using a single library is to set any or all of the iPods to manual update: Managing content manually on iPod

  • Using two iPhones with one Apple id

    Hello!!
    I am currently an iPhone 3GS user.  I just got my new iPhone 5 and as I use two numbers, thought of switching my other number to this 3GS and thus using 2 iPhones for both the numbers.  So, can someone tell me if I can use the same Apple id for both the cell or I need to create a new one to use two iPhones.  (Please note: I use iCloud only for contacts sync and dont mind having same contacts on both the devices)
    Shall appreciate a quick response!
    Thank you. 

    Really appreciate this quick response.  So I guess there won't be an issue to use the same id on two iPhones at the same time.
    Thanks again!

  • Help wanted - step by step process on how to use two ipods on one computer

    I'm just in the process of getting an ipod (waiting on delivery!) and want to know how it is possible to have two ipods using the same computer but synchronizing differently. I don't want to risk losing my partners music (he'll be very upset!) and I don't want to end up with his music on my ipod. I'd appreciate it if someone could give me a step by step guide or tell me where the best place to look for the answer is. Is it possible somehow to have two different libraries on one computer? Is that how it works?

    There are a couple of methods for using more than one iPod on a single computer. Have a look at the article linked below. Method one is to have two Mac or Windows user accounts which by definition would give you two completely separate libraries. Method two as Chris has already described above is to set your preferences so each iPod is updated with only certain playlists within one library. Have a look anyway and see what you think and go for whichever you feel suits your needs best: How To Use Multiple iPods with One Computer

  • Can I use two ipods on one PC?

    Hi, I have my own ipod, but would like to get another for my boyfriend but he doesn't have a PC, therefore everything would have to be done from mine, including different albums etc. I am sure I can do this but how does it work?
    Cheers
    Sue

    Hello Soo,
    And welcome to Apple Discussions!
    Yes you can. And there are several different methods for how to handle syncing two iPods to one computer. For the information and steps on how to handle these methods, I would check out this Apple support document.
    [How to use multiple iPods with one computer|http://support.apple.com/kb/HT1495]
    Hope this helps.
    B-rock

  • Is it possible to use two speakers with one Apple Tv ?

    Hello everyone,
    I bought an Apple Tv and I have one apple express with a Bose speaker and a Bose Link Air speaker.
    I would like to see a movie using the two speakers but every time that I try to select two speakers in the airplay Apple Tv menu, it automatically deselect the other speaker.
    Is it possible to use two speakers in the same time ? ( I know it's possible with Itunes)
    Thank,
    Ps: I have the last Apple TV

    No, that is not possible with Apple TV. You can set one 'output' via Apple TV, and 'stream' to multiple speakers from iTunes or via the remote app.

  • Can you use two ipads with one itune account

    We have two ipads and one Itunes account.  Are we able to have separate accounts within iTunes so my husband can have his games on his account and I can have mine?

    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • Can I use two webservices in one Java Bean?

    Hi,
    I have created two webservices (deployed on my local J2EE Engine). I want to use both services in one application and create a new webservice that combines the functionality of both services.
    Is this possible to combine the two services with a java bean? If yes, have I to do something special?
    Is this possible at all?
    Is there another way to do it?
    Thank you!
    Bye
    Julia

    Hi Julia,
    Yes, you can call to different web services from another service.
    For that, do one thing.
    Make deployable proxies for both Web services. Then use these both deployable proxies in your main web service from where you want to call these web services.
    Code for calling these both web services is same as you are calling web services from any other J2ee or Java project.
    Regards,
    Bhavik Devisha

  • Using two dll or one to ensure rate

    Hi, I have a project in Veristand and the rate of the target (PXI) is 1 kHz. 
    Because of the specific application is easier to use two models (dll) and tu pass the output of one model(A) to the input of the other model (B).
    By doing that do I still ensure that the whole arrange is updated at 1kHz? or do I lose one step between model (A) and model (B)?
    Sorry if it´s a stupid question. But for us it´s really important that the whole loop is executed every 1ms. 
    Thanks in advance!

    Hi,
    if you want the two models running and exchanging data it is usefull to define a special order.
    That's why multiple models in a system execute in parallel unless you define an execution order. If you want one model to wait until a second model finishes executing before the first model runs, you must define an execution order. Execution orders ensure data can transfer between models during the same iteration of the PCL.
    So have a look at this link:
    Determining the Execution Order of Models:
    http://zone.ni.com/reference/en-XX/help/372846F-01​/veristand/models_order_execution/
    I hope this helps.
    Best regards
    Suse
    Certified LabVIEW Developer (CLD)

  • HT204053 Use two phones with one iCloud account?

    Can you have two iphones with one iCloud account?

    Welcome to the Apple community.
    Absolutely. There is no problem whatsoever in using a single iCloud account for two phones. However, saying that, if the two phones are used by different people, it may well not be the best of ideas.

  • Combine two lists in one form (1 to Many relation)

    I have two list instances. I have a custom form on which I would like to show two lists and add more button to let user select to add more child records and save which should save in both the lists. And again when user pull the item from main list it should
    display the child list items as well. Can someone point me good link to achieve this.
    Thanks,
    Alex

    Hi,
    According to your description, my understanding is that you want to display two lists in a form and add item to both lists when clicking a button, also
    you want to display items in child list when searching items from main list.
    If that is the case, there is a possible solution is that you can create a custom web part with two Gridviews bind with the lists data and a button. When
    you click button, you can add list items to both grid in code behind. And, when you search the items from main gridview , you can query the list items value in child list using CAML Query to display the items in child list.
    Here are some detailed code demos for your reference:
    Create a custom web part:
    http://msdn.microsoft.com/en-us/library/ee231519.aspx
    Add or update list items using C#:
    http://msdn.microsoft.com/en-us/library/office/ee539976(v=office.14).aspx
    Query list item using CAML Query:
    http://msdn.microsoft.com/en-us/library/office/ee534956(v=office.14).aspx
    Bind SharePoint list data to GridView:
    http://sharepoint.kerenapura.com/2013/09/display-sharepoint-list-data-gridview/
    Best regards
    Zhengyu Guo
    TechNet Community Support

Maybe you are looking for

  • Keeping e-mail alarms in the bg?

    Not sure if this is an iCal question, a Mail question, or a Leopard question -- all I know is it stumped the Genius at my local Apple Store, so I'll try here first: Is there a way to have iCal-trigged alarm e-mails to be sent in the background, inste

  • Oracle Hints - Bex Query

    Hi experts, can I add a particular hints when I execute at run time a query bex ? My main scope is that when I run a bex query, the corresponding query may use an oracle parallel hint in order to increase the performance. Do you think that I can do i

  • What is the concept of Support Desk Message?

    Hi, I have little knowledge about Support Desk Message, but not sure. Can somebody explain me in details or provide notes that can explain what is it and how the functionality is used? I would like to configure it in my solution manager. I need help

  • Business Objects Reports compatibility with firefox

    Hi, Some BO web intelligence reports which were having issues on our live environment. I have noticed that the reports are having no problems with the fonts and numeric display in BO Infoview while using IE browser. The problem is noticed in BO Infov

  • SQL Loader Parallel Mode

    Hi,      I have similar issue where i have requirement to load 270 million record per day into single table(having No constraints & Indexes), where every CTL file contain 37000 records. I have machine having 16 CPU and 2 thread per CPU is set.I am us