0

We designed a cloudpage with a simple form (bootstrap CSS utilized) that has just 2 'textarea' types of fields (so, basically, free comment areas). Although the form validates without any errors, the updates are not being passed into Data Extension. We are using SAP_Account as PrimaryKey.

Here's the code we used - AMPscript and some html (I'm not pasting the entire html, no need):

Page 1:

AMPscript
    %%[ /* Page 1 */
    VAR @externalID, @url
    SET @externalID=RequestParameter('CustomerID')
    SET @url=CloudPagesURL(1691,'CustomerID', @externalID)
    ]%%
<!-- HTML - form part - page 1 -->
<div class="optin-form">
             <form action="%%=CloudPagesURL(1691)=%%" method="GET">
               <div class="form-group">
    <label for="textArea1">Question 1?
</label>
    <textarea class="form-control" name="textArea1" id="textArea1" rows="8"></textarea>
  </div>
               <div class="form-group">
    <label for="textArea2">Question 2? 
</label>
    <textarea class="form-control" name="textArea2" id="textArea2" rows="8"></textarea>
  </div>
                <div class="btn-wrapper">
                  <button class="btn btn-default" type="submit">Submit</button>
                </div>
                <input type="hidden" name="CustomerID" value="%%=v(@externalID)=%%">
              </form>

              </div>
            </div>
          </div>
        </div>
      </div>
    %%[
    /*Page 2 AMPscript - validation */

    %%[

    VAR @externalID, @extID, @url, @textArea1, @textArea2

    SET @externalID=RequestParameter('CustomerID')


    SET @textArea1 = RequestParameter('textArea1')
    SET @textArea2 = RequestParameter('textArea2')

    IF NOT EMPTY(@textArea1) THEN
    UpsertDE('Key_Priorities', 1, 'CustomerID', @externalID, 'Employee_life', @textArea1)
    ENDIF

    IF NOT EMPTY(@textArea2) THEN
    UpsertDE('Key_Priorities', 1, 'CustomerID', @externalID, 'Customer_life', @textArea2)
    ENDIF

    SET @url=CloudPagesURL(1690, 'CustomerID', @externalID)

    ]%%
<!-- html page 2- form continue-->
<div class="background-gradiant">
  <form action="%%=CloudPagesURL(1690)=%%" method="post">
      <div class="container">
        <div class="row">
          <div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
          </div>
          <div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 background-white">

            <div class="title-h3" style="color: #000000;">Thank You!</div>
          </div>
        </div>
      </div>
  </form>
    </div>
  • 2
    I think you need to name the textareas as the RequestParameter in your processing page looks via name/value pairing in POST data header. e.g. name="textarea1" – Gortonington Feb 17 at 13:26
  • 1
    Yes, exactly, that was the problem! After I added name/value into html the form started working properly. Thank you! – nix9247 Feb 17 at 16:27
  • Added as an answer for easy reference – Gortonington Feb 17 at 17:22
1

I think you need to name the textareas as the RequestParameter in your processing page looks via name/value pairing in POST data header.

For example:

  <div class="form-group">
    <label for="textArea2">Question 2?</label>
    <textarea class="form-control" name="textArea2" id="textArea2" rows="8"></textarea>
  </div>
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.