Not signed in (Sign In)

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

  1.  
    We have a multi page form and on the last page we want to move the final submit button above the previous page button. Is there a way to do this that I'm missing?
  2.  
    I tried to mess with it for a bit but the issue is you have to change the order of the code then repost it in the custom section of the form. At the same time you have to hide the second button. I made an attempt to do it but I can't hide the button.
    http://www.tfaforms.com/189818

    Read the source code below:
    <div class="wFormContainer">
    <div class="wForm wFormdefaultWidth">
    <div class="codesection" id="code-"><div class="wFormContainer">
    <div class="wForm wFormdefaultWidth"><form method="post" action="http://www.tfaforms.com/responses/processor" id="id2642252" class="labelsAbove hintsTooltip">
    <div class="actions">
    <input type="submit" class="primaryAction" id="submit-" name="tfa_submitAction" value="Submit"><input type="hidden" value="189818" name="tfa_dbFormId" id="tfa_dbFormId"><input type="hidden" value="" name="tfa_dbResponseId" id="tfa_dbResponseId"><input type="hidden" value="3449c96ad484fc784aea9223df524e62" name="tfa_dbControl" id="tfa_dbControl"><input type="hidden" value="6" name="tfa_dbVersionId" id="tfa_dbVersionId">
    <div id="tfa_questionfield-D" class="oneField">
    <label class="preField" for="tfa_questionfield">question field</label>
    <input type="text" id="tfa_questionfield" name="tfa_questionfield" value="" size="40" class=""> <br>
    </div>


    </form></div>
    I added this to the custom section. This has the button BEFORE the question but I had to give it the same ID as the normal submit button. Normally when I need to hide the submit button I would use this:
    <style type="text/css">
    .primaryAction {display: none;
    }
    </style>

    The problem here is it will also hide the button I put in the custom area.

    The bigger question to ask: Why do you want to move the submit button so it isn't the last thing on the page? Putting it above anything else will make it more likely someone will click on it by mistake. (IMHO)
  3.  
    OK, look at this:


    <style type="text/css">
    .wForm form .primaryAction2 {
    background: #FFFFFF url(images/button_bg.gif) repeat-x scroll 0% 1em;
    color: #000;
    border-color: #999 #999 #555 #999;
    -moz-border-radius-bottomleft:4px;
    -moz-border-radius-bottomright:4px;
    -moz-border-radius-topleft:4px;
    -moz-border-radius-topright:4px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;

    }
    </style>
    <div class="wFormContainer">
    <div class="wForm wFormdefaultWidth">
    <div class="codesection" id="code-"><div class="wFormContainer">
    <div class="wForm wFormdefaultWidth"><form method="post" action="http://www.tfaforms.com/responses/processor" id="id2642252" class="labelsAbove hintsTooltip">
    <div class="actions">
    <input type="submit" class="primaryAction2" id="submit-" name="tfa_submitAction" value="Submit"><input type="hidden" value="189818" name="tfa_dbFormId" id="tfa_dbFormId"><input type="hidden" value="" name="tfa_dbResponseId" id="tfa_dbResponseId"><input type="hidden" value="3449c96ad484fc784aea9223df524e62" name="tfa_dbControl" id="tfa_dbControl"><input type="hidden" value="6" name="tfa_dbVersionId" id="tfa_dbVersionId">
    <div id="tfa_questionfield-D" class="oneField">
    <label class="preField" for="tfa_questionfield">question field</label>
    <input type="text" id="tfa_questionfield" name="tfa_questionfield" value="" size="40" class=""> <br>
    </div>


    </form></div>
    <style type="text/css">
    .supportInfo {
    display: none;
    }
    </style>
    <style type="text/css">
    .primaryAction {display: none;
    }
    </style>
    <style type="text/css">
    .wFormTitle { display: none }
    </style>

    This works but messes up the styling sheet. You may need to play with it more but you can get the idea of what I'm trying to do. This is advanced coding so proceed at your own risk.
    • CommentAuthordbuschho
    • CommentTimeApr 28th 2011 edited
     
    Hello Argosy,

    If Martin's solution doesn't meet your needs, you could also try this:

    1. Add to your custom code block this code:
    <script>
    document.addEventListener('DOMContentLoaded',function(){
    var actions = base2.DOM.Element.querySelector(document,'.actions');
    //console.log(actions.previousElementSibling.lastChild); //This line shouldn't be here.
    actions.previousElementSibling.appendChild(actions);
    },false);
    </script>

    2. Once you view the form, the submit button will be moved as you described.
    Here's an example:
    http://www.tfaforms.com/202246
  4.  
    I thought he wanted the submit button above the previous page button, not below it.
    • CommentAuthordbuschho
    • CommentTimeApr 28th 2011
     
    Hey Martin,

    Is this not what you see?
    http://screencast.com/t/tyrNzMEZ

    (Chrome 11)
  5.  
    I see the submit button below the previous page button. I'm on Firefox 3.6.8. I also tested in IE8 and got the same result.
  6.  
    I see in your video it is correct however
    • CommentAuthordbuschho
    • CommentTimeApr 28th 2011
     
    Hem ...

    http://screencast.com/t/7IgykwaCGIAr

    Firefox 4.0. You seeing any errors in Firebug?
  7.  
    I don't have firebug. I have to install it and restart Firefox. Do you have IE to test with?
  8.  
    I do have the Web Developer toolbar installed. I ran a CSS check and got this link for you to look at:
    http://jigsaw.w3.org/css-validator/validator?profile=css21&warning=0&uri=http%3A%2F%2Fwww.tfaforms.com%2F202246
    • CommentAuthordbuschho
    • CommentTimeApr 28th 2011
     
    Haha, no, it's the broken CSS that's necessary to support IE6-9, Safari, Chrome and Firefox 3-4 all at the same time.

    Instead, sillyily enough, it was that I left a line of debugging code in my 5 line javascript statement ( the console.log call) . The corrected code is:

    <script>
    document.addEventListener('DOMContentLoaded',function(){
    var actions = base2.DOM.Element.querySelector(document,'.actions');
    actions.previousElementSibling.appendChild(actions);
    },false);
    </script>

    Try that after a cache purge.
  9.  
    That's got it. Good deal.
  10.  
    We tried this and the final submit didn't move above previous page button. Anything else we need to do? We did clear cache.

    Thanks
    • CommentAuthordbuschho
    • CommentTimeApr 28th 2011 edited
     
    Which form are you working with? The only way I could see a problem is if save&resume is enabled ... that might distort the order of the nodes.

    If so, you might try:

    <script>
    document.addEventListener('DOMContentLoaded',function(){
    var actions = base2.DOM.Element.querySelector(document,'#submit-').parentNode;
    actions.previousElementSibling.appendChild(actions);
    },false);
    </script>
  11.  
    The form does have save&resume turned on. I tried your code and it worked perfectly.

    Thanks everyone.