Announcement

Collapse
No announcement yet.

More than one instance of the Addendum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Re: More than one instance of the Addendum

    I know this is an old thread, but I am revisiting this question. When "hardcoding" the Addendum questions onto a page, I am trying to "save and retrieve Addendum responses when a screen is refreshed due to missing data". For Text fields, changing %question1% value="&mvte:global:question1;" works just fine, but how do I get checkboxes, dropdowns, and radio buttons to remember their selection upon page refresh?

    Thanks,
    Shannon

    Comment


      #32
      Re: More than one instance of the Addendum

      Check boxes are easy:

      If your check box looks like this:
      <input type="text" name="checkFoo" value="1" /> Check Box

      Write it as:
      <mvt:if expr="g.checkFoo">
      <input type="text" name="checkFoo" value="1" CHECKED/> Check Box
      <mvt:else>
      <input type="text" name="checkFoo" value="1" /> Check Box
      </mvt:if>

      Radio buttons

      <input type="radio" name="radioFoo" value="yes" /> Yes
      <input type="radio" name="radioFoo" value="non" /> No
      <input type="radio" name="radioFoo" value="maybe" /> Maybe

      <mvt:if expr="g.radioFoo EQ 'yes'">
      <mvt:assign name="g.radioYes" value="'SELECTED'">
      <mvt:elseif expr="g.radioFoo EQ 'no'">
      <mvt:assign name="g.radioNo" value="'SELECTED'">
      <mvt:elseif expr="g.radioFoo EQ 'maybe'">
      <mvt:assign name="g.radioMaybe" value="'SELECTED'">
      </mvt:if>


      <input type="radio" name="radioFoo" value="yes" &mvt:global:radioYes; /> Yes
      <input type="radio" name="radioFoo" value="non" &mvt:global:radioNo; /> No
      <input type="radio" name="radioFoo" value="maybe" &mvt:global:radioMaybe; /> Maybe
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #33
        Re: More than one instance of the Addendum

        Wow, thanks for the great examples! So that makes the checkboxes work for me. Now I'm stuck on dropdowns. I tried to apply the same logic as to radio buttons, but doesn't seem to be working. On screen refresh, still forgets what was selected.

        <mvt:if expr="g.question3 EQ 'google'">
        <mvt:assign name="g.question3google" value="SELECTED" />
        <mvt:elseif expr="g.question3 EQ 'referral'">
        <mvt:assign name="g.question3referral" value="SELECTED" />
        </mvt:if>

        *And I had to add " /" after the word "SELECTED" otherwise I kept getting compile errors.

        Here is the dropdown:

        <select name="question3" size="1" class="form-control" id="question3">
        <option value="">Please Select One</option>
        <option value="google" &mvte:global:question3google; />Google Search</option>
        <option value="book" &mvte:global:question3book; />Book</option>
        </select>


        What am I missing?

        Thanks,
        Shannon

        Comment


          #34
          Re: More than one instance of the Addendum

          might be that the mvt assign you are using needs to understand that you want the literal word SELECTED...so you need single quotes 'SELECTED' inside the double quotes.
          Bruce Golub
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment


            #35
            Re: More than one instance of the Addendum

            YES! That was it. Thanks!

            Comment

            Working...
            X