Pre-populate a PowerForm Envelope field using form values - docusignapi

I'm following the PowerForm docs on the following guide
https://www.docusign.com/sites/default/files/PowerForms_User_Guide.pdf
I need to save custom metadata inside the envelope, such as the User ID, so I can later
process the envelope.
I want to be able to populate a custom envelope field, using a form submission like the following:
<form action="https://demo.docusign.net/MEMBER/PowerFormSigning.aspx?PowerFormId=<ID>" method="POST">
<label for="email">Email Address: </label><input type="text" name="Signer1_Email" id="email"/>
<label for="name">Name: </label><input type="text" name="Signer 1_UserName" id="name"/>
<label for="order">Order Number: </label><input type="text" name="OrderNumber" id="order"/>
<input class="form_submit" type="submit"/>
</form>
Is this possible?
From the heading inside the docs:
Populating custom envelope fields in a Web PowerForm
Example: EnvelopeField_Region=Northwest
I have tried the following:
<input type="hidden" name="EnvelopeField_orgid" value="xyz" id="EnvelopeField_orgid"/>
<input type="hidden" name="EnvelopeField_orgids" value="aaa" id="orgid"/>
Also, I have tried navigating the docusign command center and have not found any options to add custom envelope fields to a Template or PowerForm.

What if you post the data and redirect to a built link off of that data (I'm not sure what' youre using besides HTML). I don't believe you can POST directly from a form to a PowerForm link the way it needs to be formatted.
Here's a quick PHP/JS example of what I'm referring to:
<?
if($_POST){
$baseUrl = "https://demo.docusign.net/MEMBER/PowerFormSigning.aspx?PowerFormId=" . $_POST['PowerFormId'];
$EnvelopeField_orgid = $_POST['EnvelopeField_orgid'];
$EnvelopeField_orgids = $_POST['EnvelopeField_orgids'];
$link = $baseUrl . "&EnvelopeField_orgid=" . $EnvelopeField_orgid . "&EnvelopeField_orgids" . $EnvelopeField_orgids;
?>
<script type="text/javascript">window.top.location.href='<?echo $link;?>'</script>
<?
}
?>

We were able to pass parameters to a Powerform. Below is a sample syntax of how we did it.
https://demo.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=50ac80ac-a63c-40c7-b2f4-25e93806b647&Signer1_Email=test#test.com&AccountName=Test&&Signer1_UserName=Test+User

Related

how to access form input elements in get request for node

In my html in a node application I have a form as follows:
<form action="/getRoute" method="get">
<input type="hidden" name='a' value=<%- array1[0].element1 %>>
<input type="hidden" name='b' value=<%- array2[0].element2 %>>
<button type="submit">Submit</button>
</form>
When I click submit, the getRoute route is executed successfully (confirmed by console.log statement) - however, I cannot access the values of the hidden input fields by req.body - would anyone know how I can access these, or alternatively use another html element to pass data into the route?
Just found out that you these inputs are passed via the URL and can be accessed by req.query.a and req.query.b - it's not ideal to send sensitive data via get requests since the URL can be seen.

How to Remember Pass Values Without Exposing To HTML? (NodeJS/ejs)

I tried to Google search but I did not even know what to search for!
My current problem is: say I have a customer order an item, it will show in his list of orders and he can then edit the order in the future by clicking a button next to the order.
Currently the button submits a hidden form which contains all information needed to identify a particular order and this form is passed into the edit order page through a post request. Although the form is hidden, when page source is viewed the information will still be accessible by the user.
How do I avoid exposing the information to the user? I.e do everything in the backend.
<form method="POST" action="/edit_order">
<input type="hidden" name="owner_email" value=<%=all.owner_email %>>
<input type="hidden" name="owner_email" value=<%=all.transactionId %>>
<input type="hidden" name="start_date" value=<%=moment(all.start_date).format() %>>
<input type="hidden" name="end_date" value=<%=moment(all.end_date).format() %>>
<button type="submit" class="btn btn-secondary">Change this order</input>
</form>

How to create Quiz in modx

I am new to modx and I have to create multipage quiz in my website.
Any suggestion will be helpfull.
While there are more than one way to achieve this, a combination of FormIt
and FormItRetriever extras might just be what you need. FormIt handles the processing of your quiz forms, which includes saving the data in the cache or on the database as a JSON object. And, as the name suggests, FormItRetriever allows you to retrieve previously saved form data on a subsequent page.
Here's a quick example adapted from FormIt's docs:
Page 1
[[!FormIt?
&submitVar=`go`
&hooks=`spam,redirect`
&store=`1`
&redirectTo=`id-of-next-page`
]]
<form action="[[~[[*id]]]]" method="post">
<input type="hidden" name="nospam" value="" />
<label for="qzq1">Quiz question 1: [[!+fi.error.qzq1]]</label>
<input type="text" name="qzq1:required" id="qzq1" value="[[!+fi.qzq1]]" />
<label for="qzq2">Quiz question 2: [[!+fi.error.qzq2]]</label>
<input type="text" name="qzq2:required" id="qzq2" value="[[!+fi.qzq2]]" />
<label for="qzq3">Quiz question 3: [[!+fi.error.qzq3]]</label>
<textarea name="qzq3:stripTags" id="qzq3" cols="55" rows="7">[[!+fi.qzq3]]</textarea>
<br />
<input type="submit" name="go" value="Next" />
</form>
The &store property tells FormIt to store the data in the cache for retrieval using the FormItRetriever snippet.
The &redirectTo property is the ID of your next page. FormIt will use the redirect hook, specified in the &hooks property, to redirect the user when they submit this form.
Page 2:
[[!FormItRetriever]]
[[!FormIt?
&submitVar=`go`
&hooks=`spam,redirect`
&store=`1`
&redirectTo=`id-of-third-page`
]]
/* Page 2 quiz form goes here */
The FormItRetriever snippet will allow you to display your previously saved form data with placeholders relating to the names of your form fields => [!+fi.qzq1]]
To store the quiz form data on the database, you can use FormItSaveForm. This allows you to later view the data inside a Custom Manager Page (CMP) and export it, if need be.
Refer to the official docs for more usage examples: https://docs.modx.com/extras/revo/formit

Adding photos to a venue using photos/add api and a simple form

I am trying to implement a simple form that allows me to add photos to venues (there are 30+). I followed a guide here and changed a few things to match the current api. When I use the uploader, I get the JSON response below. Is everything in order? I am getting a 200 response, but I am not seeing the photos added to their respective venue. I have also included my html for the form I am using to upload, please take a look let me know if anything is wrong. Thanks!
JSON Response:
{"meta":{"code":200},"notifications":[{"type":"notificationTray","item":{"unreadCount":0}}],"response":{"photo":{"id":"502ab14fe4b0ed9600d7722d","createdAt":1344975183,"prefix":"https:\/\/irs3.4sqi.net\/img\/general\/","suffix":"\/atVMrQ02CcgHIamCVmTugx4MCX4hIEVv1lLqbo24cnA.jpg","width":700,"height":525}}}
Form HTMl:
<form action="https://api.foursquare.com/v2/photos/add" method="post" enctype="multipart/form-data" v="20120809" >
<p>Venue ID: <input type="text" name="venueId"></p>
<p><input type="file" name="photo"></p>
<input type="hidden" name="oauth_token" value="MY OAUTH TOKEN">
<input type="submit">
</form>

Drupal 7 search parameters

I want to create a custom search box and use that to interact with Drupal's search module. Currently everything works pretty well. However, i would also need to use a proper token with the search. I have no idea what key Drupal uses to form this token.
Currently i have:
<form class="search-form" action="/search/node" method="post" id="search-form" accept-charset="UTF-8">
<input type="text" name="keys" class="search_box" value="Search ..." />
<input type="hidden" name="form_id" id="search-form" value="search_theme_form" />
<input type="hidden" name="form_token" value="<?php print drupal_get_token('search_theme_form'); ?>" />
</form>
This works well enough to display the results of one page. If i try to navigate to the second results page, all the results are thrown away.
You should probably use the more proper
$form = drupal_get_form('search_block_form');
return drupal_render($form);
http://api.drupal.org/api/drupal/modules--search--search.module/function/search_form/7
It turned out to be as simple as changing the form from post to get. Here's the html for a working solution.
<form class="search-form" action="/search/node" method="post" id="search-form" accept-charset="UTF-8">
<input type="text" name="keys" class="search_box" value="Search ..." />
</form>
You don't need to define tokens or anything of the sort.
And in theme use:
<?php
$form = drupal_get_form('search_block_form');
echo render($form);
?>

Resources