Skip to content

Commit

Permalink
added email type so that email form fields get populated with values …
Browse files Browse the repository at this point in the history
…passed through query parameters similar to text fields
  • Loading branch information
vln104 authored and vln104 committed Oct 29, 2015
1 parent 1ea413a commit 2957295
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/bundles/FormBundle/Model/FormModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ public function populateValuesWithGetParameters(Form $form, &$formHtml)

switch ($f->getType()) {
case 'text':
case 'email':
if (preg_match('/<input(.*?)id="mauticform_input_'.$formName.'_'.$alias.'"(.*?)value="(.*?)"(.*?)\/>/i', $formHtml, $match)) {
$replace = '<input'.$match[1].'id="mauticform_input_'.$formName.'_'.$alias.'"'.$match[2].'value="'.urldecode($value).'"'.$match[4].'/>';
$formHtml = str_replace($match[0], $replace, $formHtml);
Expand Down

0 comments on commit 2957295

Please sign in to comment.