• Multiple Submit Buttons

    By Michael Residori 1 decade ago

    Is there a way to specify multiple submit buttons with this latest version? I've tried a few things with no luck.

    • No,but

      By F. Kranenburg 1 decade ago

      You could create one submit (thisbutton) button for the uploader control and call thisbutton.click() from the other buttons? I'm not sure in what situation you need this?

      • Figured It Out

        By Michael Residori 1 decade ago

        I figured it out and it wound up being exactly as you had suggested - create a "dummy" button, reference that component in the control custom properties, then use javascript to click the "dummy" submit button.

        The actual requirement is to have a "Save as Draft" and a "Publish"  button to give the opportunity for the user to save a document as a draft so it will not show up on the site. There is also a "Save" button on the control that is displayed after a document is published.

        One thing I noticed, validation was bypassed on forms that included attachments. I added the following in the asyncFileUploader SSJS script library

        function saveUploadedFiles(dataSource, richTextname){

            //don't upload anything if validation fails
            if (facesContext.getMessages().hasNext()) return;

        It seems to work nicely but I haven't fully tested and was wondering if you see the same problem when validating forms? I am using server side validation for the database.

        Thanks,

        Mike

         

        • Unable to call from multiple button

          By Hekmat Mahboubi 1 decade ago

          Hi,

           

          I am trying to create the same solution of calling the upload from multiple buttons (Domino Server 8.5.2FP2). I have added alert to show that the click event is being called, but it is not. Steps:

           

          1.Copied the "btnUploadAll" button from your demo form to the new form.

          2. Added new buttons, with client side script :

          btn = document.getElementById("#{id:btnUploadAll}");

          btn.click(); 

           

          In Debugger I can see that it gets hold of the right button, but it does not seem to call the click method.

           

          If you can shed any light on this or have an example will be gratefull.

           

          • Never mind,rookie error

            By Hekmat Mahboubi 1 decade ago

            Found the problem, can not believe I fell for that. The submit button was declared after the calling buttons.