Using a form with two input type="submit" ... buttons...

Hello All!
I'm using a form to add and remove parameters for a service definition.
<form action="serviceinput.jsp" method="post">
               <table>
                    <tr>
                         <td><b>Level</b></td>
                         <td><b>Fieldname</b></td>
                         <td><b>Stucturename</b></td>
                         <td><b>Type</b></td>
                         <td><b>Format</b></td>
                         <td><b>Optional</b></td>
                         <td><b>Semantics</b></td>
                    </tr>          
     <%
                    for (Iterator iterParameters = parameters.iterator(); iterParameters.hasNext();)
          Parameter parameter = (Parameter) iterParameters.next();
     %>
                    <tr>
          <td><%= parameter.getLevel() %></td>
          <td><%= parameter.getFieldname() %></td>
          <td><%= parameter.getStructurename() %></td>
          <td><%= parameter.getType() %></td>
          <td><%= parameter.getFormat() %></td>
          <td><%= parameter.getOptional() %></td>
          <td><%= parameter.getSemantics() %></td>
                    </tr>     
     <%
     %>
               </table>
               <input type="submit" name="<%= parameters.addParameter() %>" value="add"/>
               <input type="submit" name="<%= parameters.removeParameter() %>" value="remove"/>
          </form>
The special thing about is, that I'm using two <input type="submit"...> buttons.
The idea is, that I'd like to add one more row with attributes by clicking the "add" button and removing one row by clicking the "remove" button.
If I use just one of them, it works fine. If I use both of them, nothing happens at all.
Isn't it allowed to use two <input type="submit"...> fields?
Is there an alternative? How can I implement my form the correct way?
Thanks a lot in advance to all!
Regards,
Tomi

Hi,
Hai Tomi ,
As swati already Explained U can try it with buttons,
But u have to make a Hidden field and set the value of the hidden field
with the Javascript code after pressing the button , Call a client side function which has an argument as given below
Validate the Flag field in the JSP file
<script language=javascript>
function Validate(s)
if(s==1)
     document.forms['ServiceInput'].elements["flag"].value="add";
else
     document.forms['ServiceInput'].elements["flag"].value="Remove";
document.forms['ServiceInput'].submit();
alert("hai");
</script>
<form name="ServiceInput" action="serviceinput.jsp" method="POst">
<table>
<tr>
<td><b>Level</b></td>
<td><b>Fieldname</b></td>
<td><b>Stucturename</b></td>
<td><b>Type</b></td>
<td><b>Format</b></td>
<td><b>Optional</b></td>
<td><b>Semantics</b></td>
</tr>
<%
for (Iterator iterParameters = parameters.iterator(); iterParameters.hasNext();)
Parameter parameter = (Parameter) iterParameters.next();
%>
<tr>
<td><%= parameter.getLevel() %></td>
<td><%= parameter.getFieldname() %></td>
<td><%= parameter.getStructurename() %></td>
<td><%= parameter.getType() %></td>
<td><%= parameter.getFormat() %></td>
<td><%= parameter.getOptional() %></td>
<td><%= parameter.getSemantics() %></td>
</tr>
<%
%>
</table>
<input type=hidden name=flag value="bb">
<input type="Button" name="b1" value="add" onclick= "Validate(1)">
<input type="Button" name="b2" value="remove" onclick= "Validate(2)">
</form>

Similar Messages

  • Unable to submit form wen convrting input type="submit" to a onclick=""

    Hi
    I have used following code successfully to submit my form in JSP
    <form action="email.do" name="emailForm" onsubmit="return (checkscript())">
    <input type="submit" name="actionSend" class="GRPButtonRed" value="Send">
    </form>
    Now I have subtituted above code with :
    <form action="email.do" name="emailForm" >
    Submit
    </form>
    The screen is just getting refreshed
    Edited by: money321 on Dec 16, 2008 11:14 AM
    Edited by: money321 on Dec 16, 2008 11:15 AM

    It is just because of the CSS which i hav to use which supports <a> tag for creating a button.
    But I am wondering y is screen just getting refreshed after clicking on this button which i hav created using
    <a href = "#" onclick="">

  • Changing button label;JSP; input type="submit" name="jboEvent" value="Search"

    Hello everybody,
    I try to develop a multilanguage application in which the button labels will change accordingly with the browser's regional settings.
    The line in the generated DataQueryComponent.jsp file is the following:
    <input type="submit" name="jboEvent" value="Search">
    If I want to change the value like value="Rechercher" the application will not execute the query.
    In fact the section
    <jbo:ViewCriteriaIterate datasource="dsQuery" >
    </jbo:ViewCriteriaIterate>
    is not executed.
    I tried to generate the button with:
    <input type="submit" name="jboEvent" value="Rechercher" onClick="this.value='Search'"> ,
    but for a long query the name Search will remain as button label on the screen.
    Any new solutions, please?
    Thanks in advance.

    Visit that Jakarta web site. There is an i18n tag library that you will find useful.
    http://jakarta.apache.org/taglibs/doc/i18n-doc/intro.html

  • Use checkboxes with drop down and submit button to pas values

    I have a form with six checkboxes, one drop down, and one submit button. I want the check box ON values to be appended to the hyperlinks stored in the drop down. The onclick event of the submit button sends the form results to a url with the checkbox values appended to the end of the hyperlink in the drop down. Need code please. Several programmers have bailed out on this when they got down to the event in the submit button. Can you Sun experts do better??? Here is the code for the form WITHOUT a properly programmed submit button and no javascript.
    <form name="jump">
    <select name="menu">
    <option value="http://www.whateversite.com/CP/View2Ref.php">Option 1 View 2 Test</option>
    <option value="http://www.whateversite.com/CP/AllNew.php?BK=Tap&CH=10&VR=20">option 2</option>
    <option value="http://www.whateversite.com/CP/AllNew.php?BK=Tap&CH=10&VR=20">option 3</option>
    <option value="http://www.whateversite.com/CP/AllNew.php?BK=Tap&CH=10&VR=20">option 4</option>
    </select>
    <input type="button" onClick="window.location.href=document.jump.menu.options[document.jump.menu.selectedIndex].value;
    " value="GO">
        <input type="checkbox" id="chkbx_TR_id1" name="TR" value="ON" alt="TRCheckbox" title="Search 1" tabindex="4">TR
        <input type="checkbox" id="chkbx_ES_id2" name="ES" value="ON" alt="ESCheckbox" title="Search 2" tabindex="4">ES
        <input type="checkbox" id="chkbx_NV_id3" name="NV" value="ON" alt="NVCheckbox" title="Search 3" tabindex="4">NV
        <input type="checkbox" id="chkbx_BT_id4" name="BT" value="ON" alt="BTCheckbox" title="Search 4" tabindex="4">BT
        <input type="checkbox" id="chkbx_SM_id5" name="SM" value="ON" alt="SMCheckbox" title="Search 5" tabindex="4">SM
        <input type="checkbox" id="chkbx_EN_id6" name="EN" value="ON" alt="ENCheckbox" title="Search Bible Encyclopedia" tabindex="4">ENThe resulting URL when the submit button is hit should be like this if all check boxes are checked.
    http://www.whateversite.com/CP/AllNew.php?BK=Tap&CH=10&VR=20&EN=ON&TR=ON&ES=ON&NV=ON&BT=ON&SM=ON&TR=ON"
    Thank you in advance for any replies.

    This forum is concerned with Java and not Javascript (they are not the same) . Though there are forum members who could help you on this you would probably do better to go to a Javascript forum.

  • Is possible to take the Infopath form with two repeat section in one SharePoint list

    Is possible to take the Infopath form  with two repeat section in one Sharepoint list 
    Take two repeat section and put them one bellow to other one in a SP list.
    The motive is that the first repeat section is based in account own by the requestor and the second repeat section is when the requestor is doing backup time for some one else where need to log the amount of time that spend in the peer account.
    I have basic logic in the form when requestor said Are you doing backup for some else? and press YES it is be able to use the second repeat section.
     Le me know how much pain full is going tobe or not..
    –Q1: Is possible to do this ?  With codeless or not
    –Q2:What steps I need to do to accomplish this?  feasible or not
    the following picture give a better idea of what I am looking to accomplish:
    CRISTINA&amp;amp MICROSOFT Forum

    Hi,
    Thank you for your question. I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience. Thank you for your understanding and support.
    Thanks,
    Linda Li
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • How can i control graph with two inputs?

    Hi,
        i would like to ask you about the graph with two inputs
    Normally, if i just give one input, they generate the graph with this input(y) vs time(x).
    But now i would like to get the graph with my two inputs in x axis and y axis .
    i want to control both of two axis. How could i do for it ?
    i attached the file that i try to use "Build XY graph" to control both x and y axis with random number .
    It can run but i don't know how come the graph show nothing. .
    Actually , it have to show something like wavefrom continuously. am i right?
    Could you tell me a way to solve it ? 
    >>>
    what i want to get is ..
    in Graph,
    for x axis , ditance (always increases)
    for y axis , vibration (vary)
    >>>
    Thank you so much for your time . I am looking forward your kindly reply.
    With Respect,
                            Su
    Attachments:
    using Build XY graph.vi ‏59 KB

    Hi NI9233,
    Mind me to interrupt, I am just helping Mike to explain what he meant to you, refer to the graph:
    Picture 1:
    Double click on Build XY Graph, uncheck the clear data on each call
    Picture 2 and 3:
    Change your formula node into +1 Basic Function in Functions Pallette.
    Hope that helps!
    PS: I am sorry for the size of the image, seems I made a mistakes when I saved the picture.
    Sincerely,
    Krisna Wisnu
    Message Edited by Krisna Wisnu on 11-19-2008 08:19 PM
    Sincerely,
    Krisna Wisnu
    Attachments:
    Clear Graph on Each Call.PNG ‏46 KB
    +1.PNG ‏30 KB
    +1_2.PNG ‏21 KB

  • How to use Adobe forms with F150 Dunning Run

    Hi,
    I want to use Adobe forms with the transaction F150 Dunning Run.
    How do I get the adobe form in customizing? I have put the FM 'FI_PRINT_DUNNING_NOTICE_PDF' in business transaction Event, BF31 - P/S modules of SAP app - 00001720, Fi-FI. But it is still not recognizing the ADOBE form.
    Any help is greatly appreciated.

    Hi,
    I am also working for calling custom adobe form instead of sapscript.
    While configuring BTE 1720, i noticed that configuring BTE only FI-FI application does not solve the purpose. You need to assign function module FI_PRINT_DUNNING_NOTICE_PDF for all Application Area Indicator.
    Adding to IS-PS will allow to print for customer.
    This solved my problem. But this setting is global so you need to take care of it.

  • How can I use an iPad with two itunes accounts?

    How can I use an iPad with two itunes accounts?
    Hi there
    My partner has a works iPad, which has her works Apps on (ones that are specifically made by her company and are NOT available in the App store).
    What I want to be able to do is to ALSO have my itunes account on there so that I can put all the apps I have purchased previously from my iPhone on it.
    This is so I can put on VLC player (thats already in my itunes account) so I can add videos to the iPad.
    How do I do this please?
    I tried it before by connecting it to my mac, but it wiped everything off the iPad completely and also deleted the data settings for using 3G.
    So I want to avoid this happening again the future as it had to be sent back to her head office to be sorted again.
    Any advise please?
    Thanks

    You can't. The iPad is desgined to be a 'one user' device and only really works with one apple ID at a time.
    The only way would be if she, at work and with her work apple id, downloaded your apps (repurchasing them of course).
    It's not meant to be a multiple user/multiple ID device.

  • How do I use Home Sharing with two different apple accounts?

    How do I use Home Sharing with two different apple accounts?

    Morning Saintine,
    Thanks for using Apple Support Communities.
    Home Sharing enables you to stream or transfer music, movies, TV shows, apps, and more among up to five authorized computers in your household. To do so, you will need to Turn on Home Sharing on each computer using the same Apple ID.
    Understanding Home Sharing
    http://support.apple.com/kb/HT3819
    Hope this helps,
    Mario

  • How to create a form with two column headings

    I have a business request to create a data form to handle multi year data by month. This will require creating a form with two column headings - with the first row be Year and second row be month, and data entry will begin in the third row and down.
    I can do multiple row headings in the layout design, but somehow can not get it to work for multiple column headings.
    Thanks in advance

    If you're in the "Layout" tab, simply pull the "Years" dimension and the "Period" dimension into the Column section. Planning can be a little picky about where you "drop" the dimension as you're dragging and dropping it. Drop it in the cell directly under the letter name of the column. Other than that, there's not much to it.
    Hopefully this helped,
    - Jake

  • How can one use Mission Control with two monitors?  Please bring Spaces back

    How can one use Mission Control with two monitors.  With Spaces I could treat each space as a single desktop.
    SyBB

    I use two monitors at work and have no issue. I have my mail set to use Desktop 1 and iTunes set to the second monitor of Desktop 1. I have browsers set to Desktop 2 and Fusion and RDC set to Desktop 3.
    Two things that may help you. In System Preferences > Mission Control, disable the setting "Automatically rearrange spaces...". This screwed with assigning applications to certain spaces. And the other thing is don't use full screen on apps that support it. This just makes your second monitor superfluous.

  • Using windows vista with two users and I can only open books with adobe digital editions on one account?

    using windows vista with two users and I can only open books with adobe digital edition

    You must authorize the second computer with the same Adobe ID.
    There are sometimes issues with this registration: if you have them ....
    Sometimes ADE gets its registration/activation confused and in a semi-authorized state.
    Uninstalling and reinstalling does not help.
    Unfortunately, it often then gives misleading error messages about what is wrong.
    A common incorrect message informs you that the ID is already in use on another computer and cannot be reused.
    This can often be resolved by completely removing any authorization using ctrl-shift-D to the Library screen on ADE (cmd-shift-D if on Mac).
    Restart ADE, and then reauthorize with your (old) Adobe ID.

  • How to use INVOKE function with INT parameter types

    Can you tell me how to use invoke function with int parameter type ?

    Pass the int as an Integer.

  • Handle Form Setting in a user form with two DataGrid

    Hi,
    I have a user form with two dataGrid.
    I'd like to handle the 'form settings' button for both DataGrid, but i'm not able to do it (i'm able just for the first matrix)
    This is the code:
    form.Settings.Enabled = True
    form.Settings.MatrixUID = GRID1
    There is the possibilities to swicth from GRID1 to GRID2?
    Regards
    Marco

    Hi Marc,
    you can active the settings only for one of them
    the second point is that you enable the old one.
    first change the UID than enable it.
    frm.Settings.MatrixUID = "mtxList2"
    frm.Settings.Enabled = True
    regards
    David

  • How to export data to 2 tabs in excel from form with two tabs

    Hi friends
    i am now faceing a prbs of exporting data to excel to different tabs.
    ex:- i have a multiple records form with two tab . i want to export data corresponding to excel as two tabs.
    can anyone suggest me how can i export data to 2nd tab.. is any functions or procedure to help me .

    Hello,
    at Re: How to save a query result and export it to, say excell? you can find links to different solutions. At least the packages behind second and fourth link support more than one worksheet. And both describe how to do it.
    Regards
    Marcus

Maybe you are looking for

  • Home sharing does not work with apple tv

    Can anyone help me.  I used to be able to stream all content from my home master computer to my Apply TV.  Now it suddenly does not work. Apple TV itself works just fine.  I can also airplay using it with out IPADs. I have uninstalled and reinstalled

  • How to reorder photos in folders based on capture date

    I have scanned a bunch of photographs and imported them into lightroom. I then went and changed all the capture dates to represent when the photos were actually taken. Now I would like to put the photo's in a folder structure based on the capture dat

  • Is the earphone jack on the iPhone supposed to be slightly loose?

    Is the earphone jack on the iPhone supposed to be slightly loose?

  • Archive customer development with SARA

    we would like to archive our old, not used development so it doesn't occupy db, disturb where-used lists, etc. It would be nice to have a possibility to recall such programs in some kind of read-only mode. Is there a possibility to archive developmen

  • Update user object

    I have a workflow which updates the attributes. It checks out a view, then im trying to use update user view and check in. There are no errors but the attributes never gets updated. in Update user view's subprocess there are 2 arguments, accountId an