Submitting a form with an anchor tag

How could I do this? I'm using a self submitting html form with JSP. I want an anchor tag to send some parameters to update the content of the page.

Hi,
You can use query string to pass the parameter values to the page.
Ex:
firstname and secondname are the two parameter values which you can pass it to the page.
<ahref=http://website2.com/action?val1=' firstname' & val2='secondname'> Page2</a>
if you click on the 'Page2' then those values are pass to the corresponding page
Regards
Reegan

Similar Messages

  • Wrong values submitted when submitting a form with javascript

    Hi guys, I know this aint a struts forum, but I did not know where else to go. So here goes..
    I have the following code in my jsp
    <logic:iterate id="ex" name="myForm" property="users">
    <html:multibox property="deleteUsers">
    <bean:write name="ex" property="userId"/>
    </html:multibox>
    </logic:iterate>
    I have about 10 users of which 5 have already been marked for deletion from another action. So basically, the above tag renders 10 rows with a checkbox in the beginning to select users to delete. Also 5 of them have been checked already, I mean when the form is loaded. So checkboxes 1, 4, 5, 8, 10 have already been checked. Now I have a link on which goes like this
    Select None. On this I call a javascript which does the following
    function uncheckAll() {
    for (i = 0; i < 10; i++) {
    document.myForm.deleteUsers.checked = false;
    This unchecks all my checkboxes.
    Now comes the problem. I am submitting the form using a javascript which is invoked on clicking on the submit link using document.myForm.submit(); The problem is the deleteUsers property in myForm still retains the old values. If the checkboxes are unchecked no values should be submitted for this and the deleteUsers array should be empty. Can anyone help me out on this.
    Thanks.

    Checkboxes only submit a value when they are "on"
    They submit nothing if they are not selected.
    The problem comes - do you interpret no checkbox values as "clear all values" or "leave the values alone"? Struts assumes the latter.
    Your form is probably being kept in session?
    Try implementing the reset() method of your action form and set its property to be equivalent to no checkboxes selected.

  • Submitting a form with enter key causing strange problems

    I am having a very strange problem with a webapp I am currently developing. I am using JSF 1.2 along with Facelets and RichFaces. I have coded a workflow/wizard 4-step process, and on some pages I have 4 submit buttons that all call different actions on the page. The users thought it would be useful to have the enter key submit the form, so I followed some online resources to trap a keypress using javascript, looking for the enter keycode and calling document.getElementById("elementName").click(). This works fine most of the time. Sometimes, though, it seems as if an entire new session is being created, and odd behavior starts happening. For example, my page will only include 2 of the 4 facelets on the screen -or- I will get NullPointerExceptions for objects that I know have been created in the session bean I am currently using -or- I will get a duplicate form Id after trying to re-submit the page. Could the javascript click simulation not be submitting all of the form elements or is the enter key also acting like its default action (the form submission) in addition to the "click"? I'm really at my wit's end here (plus it's nearly 3 AM, that never helps things). All of the buttons being clicked are standard h:commandButtons. There is some setTimeout logic included to disable the buttons on the page to prevent double clicks (I cannot disable them onsubmit because disabled buttons don't pass the right values, perhaps that's causing it, but if so, clicking the buttons with the mouse would cause that issue too, right?)
    I am not posting the code (yet), but if anyone wants to take a look see and see if I am doing something really abhorrently wrong, I'm more than willing to, I'm just curious if anyone has had problems regarding javascript submission of forms via the click() method. Clicking the button does not exhibit this type of behavior. Just as a side note: I am doing different things with the enter key depending if a modal window is open (the enter key closes the modal if it's up, and if not, it submits the form via a button click).
    Any help is much appreciated, if anyone has any inkling about where I should start looking for answers it would be really helpful.
    Thank you.

    edfrost wrote:
    Could the javascript click simulation not be submitting all of the form elements or is the enter key also acting like its default action (the form submission) in addition to the "click"?My guess is the second of these. You need to suppress the event handling after programmatically clicking the button.

  • Submiting HTML Forms with JavaFX Webview

    I've long been searching for a good web robot framework. And I also need a gui for my robot.
    So w/ the advent of JAVAFX Webengine it seemed my needs have been met finally. Specially because on the webview tutorial here , Alla Redko says: "+It supports user interaction such as navigating links *and submitting HTML forms*+".
    But after looking at the api it doesn't seem that webengine supports submiting forms, only loading pages w/ the load() method. I guess I could populate the form fields and submit them w/ executeScript() but that's just sloppy.
    Is there a way to actually submit forms w/ webengine? Are there plans to implement this feature, analogous to the load() method?
    Thanks,
    JC

    Yea, as I mentioned in the first post, I could do all that w/ JS but it's just sloppy, since I'm using Java language, not JS.
    The finding certain fields part is easy w/ the Document model and xpath, it's the populating the fields and submiting the form along w/ its hidden input fields that is the missing part.
    Does anyone know if these things are planned for the future of Webview/Webengine?You can already do this in Java today using the existing APIs if you so wished.
    import javafx.application.Application;
    import javafx.beans.property.*;
    import javafx.beans.value.*;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.*;
    import javafx.scene.layout.*;
    import javafx.scene.web.*;
    import javafx.stage.Stage;
    import org.w3c.dom.*;
    import org.w3c.dom.html.*;
    public class WebViewFormPost extends Application {
      public static void main(String[] args) { launch(args); }
      @Override public void start(Stage stage) {
        final TextField fxUsername = new TextField();
        final TextField fxPassword = new PasswordField();
        final BooleanProperty loginAttempted = new SimpleBooleanProperty(false);
        final WebView webView = new WebView();
        final WebEngine engine = webView.getEngine();
        engine.documentProperty().addListener(new ChangeListener<Document>() {
          @Override public void changed(ObservableValue<? extends Document> ov, Document oldDoc, Document doc) {
            if (doc != null && !loginAttempted.get()) {
              if (doc.getElementsByTagName("form").getLength() > 0) {
                HTMLFormElement form = (HTMLFormElement) doc.getElementsByTagName("form").item(0);
                if ("/oam/server/sso/auth_cred_submit".equals(form.getAttribute("action"))) {
                  HTMLInputElement username = null;
                  HTMLInputElement password = null;
                  NodeList nodes = form.getElementsByTagName("input");
                  for (int i = 0; i < nodes.getLength(); i++) {
                    HTMLInputElement input = (HTMLInputElement) nodes.item(i);
                    switch (input.getName()) {
                      case "ssousername":
                        username = input;
                        break;
                      case "password":
                        password = input;
                        break;
                  if (username != null && password != null) {
                    loginAttempted.set(true);
                    username.setValue(fxUsername.getText());
                    password.setValue(fxPassword.getText());
                    form.submit();
                    System.out.println("Submitted login for user: " + username);
        engine.getLoadWorker().exceptionProperty().addListener(new ChangeListener<Throwable>() {
          @Override public void changed(ObservableValue<? extends Throwable> ov, Throwable oldException, Throwable exception) {
            System.out.println("Load Exception: " + exception);
        GridPane inputGrid = new GridPane();
        inputGrid.setHgap(10);
        inputGrid.setVgap(10);
        inputGrid.addRow(0, new Label("Username: "), fxUsername);
        inputGrid.addRow(0, new Label("Password: "), fxPassword);
        Button fxLoginButton = new Button("Login to Oracle Forums");
        fxLoginButton.setOnAction(new EventHandler<ActionEvent>() {
          @Override public void handle(ActionEvent t) {
            if (notEmpty(fxPassword.getText()) && notEmpty(fxPassword.getText())) {
              loginAttempted.set(false);
              engine.load("https://forums.oracle.com/forums/login!withRedirect.jspa");
        final VBox layout = new VBox(10);
        layout.setStyle("-fx-background-color: cornsilk; -fx-padding: 10;");
        layout.getChildren().addAll(
          new Label("Enter your Oracle Web Account credentials"),
          inputGrid,
          fxLoginButton,
          webView
        stage.setScene(new Scene(layout));
        stage.show();
      private boolean notEmpty(String s) {
        return s != null && !"".equals(s);
    }Personally, I think using JavaScript via engine.executeScript calls in combination with jquery might be a less messy solution (as I don't like writing against the raw dom apis), but I understand that there are valid reasons why you might prefer to use a Java only solution.
    https://gist.github.com/jewelsea/3077942 "Embeds jQuery in a document loaded into a WebView."

  • Submitting a form with customize subject line

    Hi
    I would like some help with Submitting a form via E-mail with a customize subject line. I want the subject like to be the First name of the person which they would have to enter in the form. Is this possible?
    Thanks

    Look at this previous thread:
    http://forums.adobe.com/message/5615207#5615207
    The script would look something like:
        //Place into a submit button     
         var cSubLine = this.getField("FirstName").value;       //Replace FirstName with the name of the field on your form
         this.mailForm({
         bUI: true,
         cTo: "[email protected]",
         cSubject: cSubLine,

  • Combine pt://return with named anchor tag

    I have a situation where I need to use the pt://return transformer tag in order to return to portal. However, I would also like to scroll/focus the page to a named anchor tag.
    In other words I have this html on the page that the user is returning to:
    <a name="TopNews" id="TopNews"></a>
    I need to create a return tag something like this:
    Back to Top News
    Any suggestion on how to go about doing this is greatly appreciated - Tanner

    What are you returning to? A My page, or community page, or other? I'm including some tricks I have used in the past to get the browser to go to a URL on the portal server... they might be worth a try.
    If it is a community page you may be able to use a transformer tag and javascript to send the user to the location.
    <pt:openerLink xmlns:pt="http://www.plumtree.com/xmlschemas/ptui/" pt:mode="2" pt:classID="512" pt:objectID="OBJECT_ID_HERE" id="NewsCommunityLink"></pt:openerLink>
    <script>
    function goToNewsCommunity() { <pt:transformer pt:fixurl="off" xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/> document.location = document.getElementById('NewsCommunityLink').href + "#TopNews"; <pt:transformer pt:fixurl="on" xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/>}
    </script>
    If it is the users home you might try this:
    <script>
    function goHome() { <pt:transformer pt:fixurl="off" xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/> document.location = "/portal/server.pt?#TopNews"; <pt:transformer pt:fixurl="on" xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/>}
    </script>

  • Trouble submitting PDF form with Web Mail

    Hello,
    I have a fillable PDF form that I'm trying to submit. When I submit the form through an email client (Outlook, Mail, etc.) it works perfectly. When I try to submit using the Webmail option, I get this message: "An unknown error has occurred while uploading the attachment. If you are not sure how to proceed further, you can save your form and return it manually using your Internet mail service."
    I've checked the file thoroughly and everything looks correct. I'm perplexed as to why it submits just fine through an email client, but won't submit via Webmail. I've tried on a Mac and a PC and I've tried using a Yahoo account and a Gmail account with the same results. Any ideas?
    Thanks!
    Kate

    I'm using Acrobat XI Pro. I don't have Reader installed on my laptop. The form is for a client who sends it out to patients to fill out, so I need it work with both mail clients and web mail. Is there a way to do that? I don't think changing that preference in my Acrobat will solve the problem, as that will just effect my Acrobat. Is there a setting I can apply to the actual document? Thank you for your response!

  • Submiting a form with variables packed into an associative array

    I have a complex form created in flash that submits to a
    shopping cart. I was having trouble getting the variables in the
    right format for the shopping cart to accept.
    So I created a bridging script in php that fills in the
    hidden fields of a form then uses javascript to submit it to the
    cart. This works but I would like to submit the variables directly
    to the cart and eliminate the need for a bridge.
    At the moment I am simply using
    getURL("bridge.php", "_self", "POST");
    to POST the variables to the bridge.
    The bridge code is
    <?php
    $id[txt_1] = "$colortext";
    $id[txt_2] = "$xheight";
    $id[txt_3] = "$xwidth";
    $id[txt_4] = "$nopanels";
    $id[txt_5] = "$shutterstyle";
    $id[txt_6] = "$squarearea";
    $id[txt_7] = "$finish";
    $id[txt_8] = "$bifoldoption";
    $id[txt_9] = "$slidingoption";
    $id[txt_10] = "$hingedoption";
    $id[txt_11] = "$totalprice";
    $id[txt_12] = "$colorcode";
    $products_id = "28";
    ?>
    <form
    action="product_info.php?products_id=28&action=add_product"
    method="post" name="MyForm" target="_self">
    <input type="submit" name="Submit" value="Submit">
    <input name="id[txt_1]" type="hidden" value="<?php
    print($id[txt_1]); ?>">
    <input name="id[txt_2]" type="hidden" value="<?php
    print($id[txt_2]); ?>">
    <input name="id[txt_3]" type="hidden" value="<?php
    print($id[txt_3]); ?>">
    <input name="id[txt_4]" type="hidden" value="<?php
    print($id[txt_4]); ?>">
    <input name="id[txt_5]" type="hidden" value="<?php
    print($id[txt_5]); ?>">
    <input name="id[txt_7]" type="hidden" value="<?php
    print($id[txt_7]); ?>">
    <input name="id[txt_6]" type="hidden" value="<?php
    print($id[txt_6]); ?>">
    <input name="id[txt_8]" type="hidden" value="<?php
    print($id[txt_8]); ?>">
    <input name="id[txt_9]" type="hidden" value="<?php
    print($id[txt_9]); ?>">
    <input name="id[txt_10]" type="hidden" value="<?php
    print($id[txt_10]); ?>">
    <input name="id[txt_11]" type="hidden" value="<?php
    print($id[txt_11]); ?>">
    <input name="id[txt_12]" type="hidden" value="<?php
    print($id[txt_12]); ?>">
    <input name="products_id" type="hidden" value="28">
    </form>
    <script type="text/javascript"
    language="JavaScript"><!--
    document.MyForm.submit();
    //--></script>
    I am trying to create in flash 8 the equivalent of the above
    form using the function below.
    function submitvars() {
    var id: Array = new Array();
    id.txt_1 = colortext;
    id.txt_2 = xheight;
    id.txt_3 = xwidth;
    id.txt_4 = nopanels;
    id.txt_5 = shutterstyle;
    id.txt_6 = squarearea;
    id.txt_7 = finish;
    id.txt_8 = bifoldoption;
    id.txt_9 = slidingoption;
    id.txt_10 = hingedoption;
    id.txt_11 = totalprice;
    id.txt_12 = colorcode;
    var myvar:LoadVars = new LoadVars();
    myvar.id = id;
    myvar.products_id = '28';
    myvar.send("product_info.php?products_id=28&action=add_product",
    "_self", "POST");
    So far the variable products_id = ‘28’ transfers
    over to the cart fine but not the variables in the ‘id’
    array

    You're welcome.
    I've never used register globals, couldn't figure that out,
    thanks for explaining.
    The other way to do it if you want to send an array of simple
    data (usually all of one data type like string or number) is to use
    array.join("delimiter_sequence"); in flash. You can then assign it
    to a single property of your loadvars (e.g. 'id') and use explode
    in php with the same delimiter to recreate an array. This does not
    give you an associative array though, just a regular numeric
    indexed one.
    To send complex data like arrays and objects, you can use
    other encoding techniques. You can even use json: json.org has a
    json class(es) for flash and php 5 has json encoding/decoding
    support for example.
    Another way is to use amfphp and remoting, which does all the
    work for you. And of course, you have XML support as well at both
    ends, so you can always represent complex data in XML if you
    prefer. You may want to investigate these or other methods on
    future occasions.

  • Submitting multiple forms with one Submit button?

    I'm working to create a web app for the iphone and am using
    an apple developed css within an html page. In doing so I have
    created three forms within the single page and would like to submit
    them simultaneously with one submit. I've looked and tried a few
    javascripts but nothing has worked thus far. All three forms call
    the same action (php).
    Is this possible using js or another function?

    .oO(iRyFlash)
    >I'm working to create a web app for the iphone and am
    using an apple developed
    >css within an html page. In doing so I have created three
    forms within the
    >single page and would like to submit them simultaneously
    with one submit. I've
    >looked and tried a few javascripts but nothing has worked
    thus far. All three
    >forms call the same action (php).
    >
    > Is this possible using js or another function?
    Make it a single form.
    Micha

  • Submiting multiple forms with one button

    I have a form that has a cfform within it. The cfform has a
    cfloop in it that includes an id and a dropdown list box that
    includes a new id. I want to transfer one id to another. I want the
    user to be able to click on one button that would update all the
    rows in the table with the new id.
    If there are 3 rows in the query, the user would select an
    entry in a dropdown for each row and upon clicking on the submit
    button all three rows would be updated with the id selected from
    the dropdown.
    Any suggestions?
    Thanks for the help!
    Gary

    There isn't a way to set this up using the Paypal payment integrated into FormsCentral using seperate forms for each child, you can set up one form so they can register additional children and then pay in one session, but if you need each child to be a unique form submission it can not be set up to pay for multiple at once.
    Thanks,
    Josh

  • I am having a problem with check boxes showing as all selected after downloading as a pdf after individual submits their form with just a few actually selected.

    The forms themselves don't have all the boxes checked when viewed in FormsCentral. It is only after I download it as a pdf that the problem occurs. I have to check and uncheck each box in the FormsCentral in order to not have that occur. Any suggestions?

    Hi sdwinter,
    Please help us with the step by step workflow to replicate the issue for better assistance on this.
    Thanks,
    Vikrantt Singh

  • WL 8.1 BEA-101083 error when submitting a form using javascript (IE only)

    Hello,
    I have a JSP page that is submitting a form with javascript document.form.submit()
    after checking the validity of form element values, but I randomly get a BEA-101083
    error. The jsp page has worked fine for several year in IPlanet, and Sun One
    7 application server, but when ported over to WebLogic 8.1 SP2 the error manifests
    itself. Basically, when user submits the form, the next page is displayed with
    null values, and soon after the following stack trace appears in the server log.
    This error only occurs when the client browser is IE, Netscape works fine.
    Thanks,
    -Colin
    <WLS Kernel>> <> <BEA-101083> <Connection failure.
    java.io.IOException: A complete message could not be read on socket: 'weblogic.servlet.internal.MuxableSocketHTTP@9bb9300
    - idle tim
    eout: '30000' ms, socket timeout: '30000' ms', in the configured timeout period
    of '60' secs
    at weblogic.socket.SocketMuxer$TimeoutTrigger.trigger(Lweblogic.time.common.Schedulable;)V(SocketMuxer.java:775)
    at weblogic.time.common.internal.ScheduledTrigger.run()Ljava.lang.Object;(ScheduledTrigger.java:243)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.Privil
    egedAction;)Ljava.lang.Object;(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.a
    cl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(SecurityManager.java:118)
    at weblogic.time.common.internal.ScheduledTrigger.executeLocally()V(ScheduledTrigger.java:229)
    at weblogic.time.common.internal.ScheduledTrigger.execute(Lweblogic.kernel.ExecuteThread;)V(ScheduledTrigger.java:223)
    at weblogic.time.server.ScheduledTrigger.execute(Lweblogic.kernel.ExecuteThread;)V(ScheduledTrigger.java:50)
    at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:170)
    at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)

    Checkboxes only submit a value when they are "on"
    They submit nothing if they are not selected.
    The problem comes - do you interpret no checkbox values as "clear all values" or "leave the values alone"? Struts assumes the latter.
    Your form is probably being kept in session?
    Try implementing the reset() method of your action form and set its property to be equivalent to no checkboxes selected.

  • Anchor tag-line moving on hover in IE6.

    Hi Folks,
    Does anybody know if there is an issue with IE6 anchor tag
    lines moving on hover?
    I've got a sliding panel widget with an anchor tag line
    inside of an AP DIV TR TD (first | previous | next | last);
    initially displaying skewed, but then popping into perfect position
    as soon as the mouse hovers over one of the links; Then slides the
    panels
    fine, then goes back to the skewed position until it's
    hovered on again... This problem is not occuring in IE7, FF, N9.
    - GR

    Solved it by putting a width and height on the parent table.
    I guess IE6 is not as forgiving as IE7...

  • Submit multiple forms with java

    Hello,
    I have a problem when I am submitting multiple forms with the javascript document.form1.submit();.
    I shall explain what my problem is. I have made a JSP that contains some forms. In the forms I post values to external sites. so the action from the forms are http://www.example.com/employee/login. I post my username and password to this external link so I have logged in. So I do this for 20 different sites. so 20 different actions in 20 different forms on one JSP.
    Now I have made one button that submit all of this forms. I do this with the javascript document.form1.submit();
    document.form2.submit();
    etc.
    But this is not consistent and I wan't a sollutions in Java so I am sure that all the forms wil execute. Because now he post only some forms and some not. So i want a solid sollution. Can anyone help me.
    Thanks in advance,
    Henk

    I had a similar situation a few years ago, where I needed to close sessions that my application had opened with different servers.
    The way I did it was with a secondary browser window, which my "primary" window would control. I had a JavaScript routine that would set the URL of the secondary window, loop with a timer and check the state of that window until the request had completed, then send the next URL, until I had "fired off" URLs to close all of my sessions.
    If this sounds like something you'd be interested in doing, let me know and I can post the code here.
    James W. Anderson
    The Coca-Cola Company

  • Netui: anchor tag with target attribute.

    I am using the netui:anchor tag inside an iframe to post to an action. But the
    resulting page is displayed within the iframe. Will the target attribute of the
    netui:anchor tag help solve the problem. What is a valid value of the target
    attribute.
    thanks,
    Shankar

    does the action have a formSubmit = true? If not then your modal dialog should be shown via the onclick and you have to javascript the link click (based on your modal dialog options)
    If you do have a formSubmit=true, then you'd have the onclick show the modal dialog and you would have to write additional javascript to submit the form (Along with setting its action)
    regards
    deepak

Maybe you are looking for

  • Multiple Libraries & duplicates

    I am sure that my problem is common so hopefully this post will help other people solve similar problems. It may have been answered in other posts although nothing has popped out as a clear and concise way to solve how to deal with multiple libraries

  • How to ivoke a method on an object of a private class

    When I did it I got a java.lang.IllegalAccessException.

  • Saving image using mobile into sap R/3

    We are using sap mobile platform version 2.3 and our client requirement is to save images using mobile apps. We already saved images in mime repository but for this we have to required client modifiable , but due  to security reason we can't do this.

  • MacBook Pro External Speaker Hum With External Display

    When I plug my MacBook Pro into a set of external speakers, I get a loud-to-deafening hum depending on the volume that the speakers are set to. However, this only happens if I have an external monitor plugged in. I unplugged the macbook, and this did

  • Fade Through Black Transition Not Displaying Properly

    Greetings all. I have imported my movie clips into iMovie '08. Each of the clips plays fine by themselves as well as when edited and combined in my project. The problem arrises when I try to add a Fade Through Black (or any transition for that matter