Associating two events with submit button using  javascript in jsp

Hi
How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

Have something like :
<input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

Similar Messages

  • Adobe Reader Submit Button using JavaScript

    We have a form that when submitted it needs to use javascript to update the Subject Line of the email message for our workflow process. This process works absolutely great when using Acrobat. However, when sent to someone using Reader (even with JavaScript enabled through preferences) nothing happens when the button is clicked. The form was designed in Acrobat 10 Professional.
    Here is the JavaScript we are using...
    var wsuid = this.getField ("mywsuid");
    var d = new Date();
    var month = d.getMonth()+1;
    var day = d.getDate();
    var year = d.getFullYear();
    var today = ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + '/' + day +  year;
    var name = this.getField("name");
    var subject = "subject: " + (wsuid.valueAsString) + ":" + (name.valueAsString) + ":" + (today);
    this.mailDoc({
        bUI: true,
        cTo: "[email protected]",
        cCc: "",
        cSubject: subject,
    Suggestions on getting this to work with Acrobat Reader is much appreciated.
    Dawn Bleuel
    Wichita State University

    I was able to open the JavaScript debugger in Acrobat Pro. When the document is Reader Enabled, I get the following message:
    Acrobat EScript Built-in Functions Version 10.0
    Acrobat SOAP 10.0
    NotAllowedError: Security settings prevent access to this property or method.
    Doc.subject:15:Field Submit:Mouse Up
    And in Acrobat Pro - I now see Protected View is set to Off.

  • I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Cent

    I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Central in order to use this feature. What gives? The Adobe site gave me the impression that I would have this feature after purchasing the new upgrade. I would not have purchased the upgrade, let alone five of them had I know this. Am I missing something?

    Acrobat XI comes with the Fromscentral AIR application and the ability to create PDF forms authored in Formscentral. To have more than the free (1 form with 50 responses) level account you need to sign up for a Formscentral subscription.
    Andrew

  • Disable button using javascript

    Hi,
    I'm sorry if this is a relatively simple problem, but I have tried several things and have searched the forum, but still no luck!
    I am trying to get a button in a form to be disabled or hidden on loading the page and only to become enabled or shown once an 'onclick' event occurs. I already have a javascript function running successfully on the 'onclick' event, so there is no problem with that.
    Preferably I would like the button to be template driven, but I realise that disabling/hiding it may only be possible with an HTML button.
    I have tried the following JavaScript, but it appears to do nothing:
    document.getElementById('P6_OK').disabled=true;
    $x_HideItemRow('P6_OK');
    If the JavaScript is ok it is probably the way I am implementing it into the HTML.
    Thanks
    Lucy

    Hi,
    I'm still having troubles with this (see above). If anyone has successfully managed to disable a button using JavaScript I would be interested in how they did it.
    To clarify, I have tried the following two pieces of script, among others:
    (1) document.getElementById('P6_OK').disabled=true;
    (2) $x_HideItemRow('P6_OK');
    I have read quite a few forum links and followed what others have done, but in vain.
    Thanks for your help
    Lucy

  • Hide an HTML button using javascript

    Hi,
    I need to hide an html buttton using javascript. I have an radio button with values "YES" and "NO". If is select NO then i need hide the button without refreshing the page. Can anyone suggest me how to hide an button using javascript.
    Thanks
    Prashanth

    Prashanth,
    The exact solution will vary based on a few factors. The basic idea is to place an event handler on the radio button item that calls a function to hide/show the button. You might also want to call that function when the page loads too.
    If you put an example page on apex.oracle.com and provide the workspace/username/password I'll take a look. You can create a new account for this purpose.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • 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.

  • Any way to communicate with Serial PORT using JavaScript

    is there any way to communicate with Serial PORT using JavaScript ??
    Dont tell me to do it in java because I need to this on client side not on server side.
    such as when client pressed the button, a javascript function will be called and in that function I need to communicate with the serial port of that client... That action will not go to server side.

    Is there any way to send a string of bytes to the serial port from the client side ?
    Just a button on the web page that sends out stuff to the comport.
    I was hoping to do this using java script also ..

  • I have an InfoPath with submit button, publish the same to form library.

    Hi All,
    i have an InfoPath with submit button, publish the same to form library.
    Now, i open the form  fill it and attach some files, when i press submit button, that attachments will go to the particular document library.
    Can any one help me out.
    Thanks in Advance!

    Hi Anil,
    According to your description, my understanding is that the attachments attached to the form were submitted to an documents library.
    By default, the attachments should be attached with the InfoPath form and will not be submitted anywhere.
    There may be some customizations on the form that is to submit the attachments to the document library.
    Please check the links below if the customizations are made in the form.
    http://www.bizsupportonline.net/blog/2010/01/upload-document-sharepoint-infopath-form/
    http://www.bizsupportonline.net/blog/2010/04/top-10-questions-infopath-file-attachments/
     Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • How to open a pdf from pdf target with page no using javascript

    Hi
    How to open a pdf from pdf target with page no using javascript
    Thanks in Advance.

    Hello,
    <p>Web.show_document calling .htm files saved on disk.....</p>
    Francois

  • How do you Delete a Record using Form with submit button?

    Hi,
    The table REGISTRATION has two feilds, FULL_NAME and USER_GROUP. I created a form that has a drop down
    of all the FULL_NAME values that allows the user to select the record that they want to delete. I got the drop down to work and
    created the Delete Record behavior, I just can't get the submit button to send the form data and cause the delete to happen.
    I have created other pages that update records in this way, but for some reason, I can't get delete to work.
    Any Ideas?
    Thank You in Advance,
    Eric
    Ps     Anyone know why this site locks up in I.E. on some PC's? My Company PC is locked down and they won't investigate. My laptop works but says error on page. I have the latest updates and JAVA ...
    Here is the code:
    <cfif IsDefined("FORM.Full_Name") AND #FORM.Full_Name# NEQ "">
      <cfquery datasource="ilmf_parts">
      DELETE FROM REGISTRATION
    WHERE Full_Name=<cfqueryparam value="#FORM.Full_Name#" cfsqltype="cf_sql_clob" maxlength="50">
      </cfquery>
      <cflocation url="index.cfm">
    </cfif>
    <cfquery name="REGISTRATION" datasource="ilmf_parts">
    SELECT Full_Name, User_Group
    FROM REGISTRATION
    ORDER BY Full_Name ASC
    </cfquery>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>User Delete Test Page</title>
    </head>
    <body>
    <p align="center">USER DELETE TEST PAGE </p>
    <p> </p>
    <form action="index.cfm" method="post" enctype="multipart/form-data" name="Delete_Form" id="Delete_Form">
      <table width="500" border="1" cellspacing="1" cellpadding="3">
        <tr>
          <th scope="col">NT Name </th>
          <th scope="col"><select name="select">
            <cfoutput query="REGISTRATION">
              <option value="#REGISTRATION.Full_Name#">#REGISTRATION.Full_Name#</option>
            </cfoutput>
          </select>
    </th>
        </tr>
        <tr>
          <td> </td>
          <td><input type="submit" name="Submit" value="DELETE" /></td>
        </tr>
      </table>
      <p> </p>
      <p> </p>
    </form>
    <p> </p>
    </body>
    </html>

    The name of your form control is "select".
    <select name="select">
    The name of your form field in your SQL is full_name
    <cfqueryparam value="#FORM.Full_Name#" cfsqltype="cf_sql_clob" maxlength="50">
    You probably really want these names to match!
    P.S.
    Is your name field really a "clob" data type?  Just how long are these names anyway.
    P.P.S.
    Why are you relocating from the page index.cfm to index.cfm?
    <form action="index.cfm" method="post" enctype="multipart/form-data" name="Delete_Form" id="Delete_Form">
    <cflocation url="index.cfm">

  • Help with submit button, signatures and locking fields

    https://acrobat.com/#d=sCcToPsLqquP0uePmVL1pQhttp://https://acrobat.com/#d=ZsRL5CeME*4iV3VHnvUFXw
    Well here's a doozy for ya. I have no idea what I'm doing as you will be able to see when you look at my form.
    What I want to happen is to have the user fill out the form, choose the operations manager and select submit button associated with the drop down box. All other dropdown boxes and submit buttons should be hidden. I need the form to lock so there are no edits except the signature field, the next dropdown box and submit button. I'd like to customize the email with a specific subject line and specify the email address based on the person selected from the drop down box. I'd like this to repeat itself until there are no more signature fields left. It is very important that this document follow the order specified.
    I tried to use an example Niall put out there to use regular buttons as submit buttons with script. I changed a couple things and it worked to submit the form based on the person selected but I still do not know how to lock the fields. Long story short, I broke what did work and don't know how to do what I really want to do or fix what had once worked. I don't understand javascript so please, if you're willing to help teach me, be patient and spell it out like i'm speaking a foreign language.
    Oh boy, even I don't want to do this. What a mess!

    I believe that you should re-post this in either the Forms or the Designer forum.  You are more likely to get the right folks to look at it there.
    Generally this forum is for building custom Document Service Component (DSC) plugins that extend the LiveCycle ES server side product.

  • Fighting with Submit Button and Return Address / distributing Forms

    I go crazy, too ! We designed some smart forms for a new evaluation process, too, and had a successfully test within our IT collegues. Now we handed the process over to the users, and the problems are on!
    We made sure that everyone uses the same version of Adobe 9.1.2 Pro - but not 2 users do have the same results.
    We found following 2 major issues:
    1) When opening the _distributed.pdf - users either completly missing the pink bar with  Highlight fields / Submit Form
    or, very odd, just the Submit Form button
    2) For those who fortunatly have the Submit Button, another odd thing happens:
    The Send form correctly shows the to: address .....
    Our Desktop Email Application is Notes...
    Guess what .... Now the Email adress changes to [email protected]   ( this worked fine in our testings before...)
    Do you have any clue from where this address is pulled ???? We checked the identitity Info in the Adobe installation at the users computers, the email and name entries are correct there.....
    Please help !!!

    I am pretty sure the answer is in the script. I have put together pieces of script from other suggestions and I am pretty sure I have ascrewed something up  along teh way. I have looked at the attached link and that is where I got some of the script you see below. I am sure you will refer to me as the hatchet person who chopped the script up. sorry. (It is in the Mouse Up) This does work, sort of...It will give the user the message that the required fields are not filed in if they are blank, but it will send the email, but without the custom message in the subject line.
    if (employeename.rawValue != null || employeename.rawValue != "") {
    vSubject  = "Form completed by " + employeename.rawValue;
    vBody = "The form has been sent by " + employeename.rawValue;
    if  (completedate.rawValue != null || completedate.rawValue != "") {
    vBody   = vBody + " on " + completedate.rawValue;
    if  (EmployeeID.rawValue != null || EmployeeID.rawValue != "") {
    vBody = vBody + " Your ID is: " + EmployeeName.rawValue;
    var oDoc = event.target;
    oDoc.mailDoc({
         bUI: false, 
         cTo: "[email protected]",     cSubject: "Statement from " + EmployeeName.rawValue + "

  • Edit email for submit button and Javascript?

    How can I change an email address attached to a submit  button on a previously created form? 2) How can I see if JavaScript is being used with form? A prior team member created interactive forms with a submit button. Email address attached to button needs to be updated. I tried to edit in Acrobat Pro by double  clicking the button to access the properties panel, but it doesn't open. If I recreate the form to amend the address, my file size is about 1/3 of the original which leads me to believe there is JavaScript.

    Thank you. My version of Adobe Acrobat Pro X  Tools- Forms edits in
    LiveCycle Designer after the form has been created and saved.. There is no
    other edit option as shown in the screen print below. The action wizard in
    Pro doesn't seem to apply in this case. I had tried right clicking the
    button in both Pro and LiveCycle previously to no avail. However, when the
    form opens in LiveCycle, I just figured out that there is an object window
    that allowed me to modify the email address.
    However, I don't understand the file size difference or even how to find
    the JS. We both used the same original word docx. His file size is 47K and
    my recreated file is 19K, a big difference. I didn't compress mine. Any
    thoughts on what is causing the difference? The forms are on a client's
    website for external users to complete so load time is still important.
    Thanks,Vickie
    On Fri, May 23, 2014 at 4:24 AM, Gilad D (try67)

  • Spry validation issue with submit button

    Hi,
    I'm new to Spry but am having an issue getting it to work at all.  I created a very simply form (i.e. table with Spry text field and submit button).  I've read many articles and been to several forums, but I can't seem to find the issue I'm having.  Basically, when I go to preview the page in a browser, the table with the Spy text field and submit button comes up fine, but when I hit the submit button, I see the page refresh and any values I had in the text field disappear, but nothing ever comes up saying "A value is required," which is what I'm looking for. This happens even if I don't have any values in the text field.  Below are images of what I'm describing and also the code.  I verified that the "Required" check box is checked in the SpryTextField and the submit button action is selected to "Submit Form."  My setup is Win 7, DW6, & XAMPP.  Any help you can provide would be greatly appreciated.
    Before Submit Button pressed:
    Browser after button pressed: (same as above but no message saying "A value is required.")
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    test
    <table width="600" border="1">
      <tr>
        <td><form id="form1" name="form1" method="post" action="">
          <span id="sprytextfield1">
          <label for="test"></label>
          <input type="text" name="test" id="test" />
          <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
        </form></td>
      </tr>
      <tr>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
      </tr>
      <tr>
        <td><form id="form2" name="form2" method="post" action="">
          <input type="submit" name="submit" id="submit" value="Submit" />
        </form></td>
      </tr>
      <tr>
        <td> </td>
      </tr>
    </table>
    <script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "email");
    </script>
    </body>
    </html>

    Do yourself a big favor and don't waste time with Spry Validation.  Most modern browsers support HTML5 forms with the required attribute. 
    If you must placate older browsers, use jQuery validate script.  It's lightweight and works when HTML5 support is missing.  You can see an example below. If you hit submit with empty form fields, the required fields pop-up with messages.  View source in browser to see the code. 
    HTML5 Form with jQuery Validation
    Nancy O.

  • Client side validation with submit button in another region

    Hi,
    I have two regions, one containing a form with input texts for the user to fill in, and another region with a command button. A few of the input fields use the ADF "required" validator.
    My problem is that when I click the submit button, and it does some logic to commit the form to a data base, even if the validator triggers and says that one of the required fields is empty, all the other fields get committed, except the ones that are empty. They get the last valid value.
    What I want is the button to trigger the ADF message that doesn't allow the user to continue with the update. This doesn't happen though.
    Anyone have any ideas? If you need a more thorough explanation, please let me know.

    Regions work as indipendent pages.
    Yet if submit buttons are partialSubmit="false" then both regions (pages are submited).
    Still there is a bug when commiting data:
    [http://adfbugs.blogspot.com/2009/08/page-with-region-validations-bug.html]

Maybe you are looking for

  • COGI : how to display the time of  a goods movement?

    Hello, through COGI, I get the good movements with error per material. When I open the errors list for a material, I get the posting date for each good movements but not the time!  Could you please let me know how to do for displaying error time or p

  • How to Enable a Button

    Hello, I have a little problem to Enable a Button. I have a Text-Item and a Button in my Form-Modul. I want to write a Code which checks if the Text-Item is Null. If it is then the Button must be enabled. But which Form-Trigger must I use to do this.

  • File Upload in Webdynpro ABAP

    Hello, I would like upload a excel file in Webdynpro for ABAP and I get the data in a attribute in the context node. The data is there in Binary format. If it is possible to get the data in the ASC format like the function "ws_upload"? I had tested w

  • Travel for ESS with WD ABAP

    Good morning. I am implementing Travel for ESS. We implement the business function FIN_TRAVEL_1 for work with Webdynpro ABAP. We are implementing ESS for a country not deliverd by SAP. We copy the folder of ESS/MSS, for modify the role of Employee Se

  • ABAP Views using in Programming

    Hi Experts, I am going to create a report using <b>Views</b> concept. I don't know about Views concept. How i have to create view. how can i use the same in program for more than one table. Please send me a sample code. I hope that i will get answer