Skip to content

Instantly share code, notes, and snippets.

@wdebusschere
Last active October 31, 2018 12:04
Show Gist options
  • Save wdebusschere/b956750121af5d1c7cf60fd7460401f0 to your computer and use it in GitHub Desktop.
Save wdebusschere/b956750121af5d1c7cf60fd7460401f0 to your computer and use it in GitHub Desktop.
When you need to copy the value of a field in another field
<!--
Usecase example: You have a section and you want to replace a textbox field with a number field.
1. Create a datasource which loads the section and the oldfield
2. Add the datasource to a page with this html
3. Create an event with allow multiple
Tip: you can use paging 500 records {$url-page} in your datasource and ?page=1 in your url.
-->
<form method="post" action="{$current-url}/?debug" enctype="multipart/form-data">
<input name="MAX_FILE_SIZE" type="hidden" value="5242880000" />
<table>
<xsl:for-each select="/data/dstest/entry">
<tr>
<td><input name="id[{position()}]" type="text" value="{@id}" /></td>
<td><input name="fields[{position()}][newfield]" type="text" value="{oldfield}" /></td>
</tr>
</xsl:for-each>
</table>
<input name="action[eventname]" type="submit" value="Submit" />
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment