I’ve used a combination of eForm2db and eFormPopulate to fill fields from an existing record id - it’s working but I can’t seem to get the textarea "message" to work
I’ve set placeholders in my populate snippet:
$modx->setPlaceholder(’name’, $row[’name’]);
$modx->setPlaceholder(’email’, $row[’email’]);
$modx->setPlaceholder(’subject’, $row[’subject’]);
$modx->setPlaceholder(’message’, $row[’message’]);
in my form chunk I have all input fields as:
value="[+name+]" etc..
and the textarea field as:
<label for="cfMessage">Message:
<p><textarea name="message" id="cfMessage" eform="Message:textarea:1">[+message+]</textarea></p></label>
but not getting anything in the text area?
any ideas/suggestions greatly appreciated
thanks
You might have to change the db field from e.g. varchar(255)
to text. But that shouldn’t stop output. What if you remove the eform validation rule?
thanks for the suggestion mrhaw, I’ve tried removing the "eform="Message:textarea:1" but still not getting anything - the db field is already set to text
Weird - if I add an extra text input with the same value as the textarea but disable this extra field: ( disabled="disabled" ) it seems to work perfectly
<label for="cfMessage">Message:
<p><textarea name="message" id="cfMessage" eform="Message:textarea:1>[+message+]</textarea></p></label>
<p><input name="message" disabled="disabled" id="cfMessage" type="text" value="[+message+]" eform="Message::1" /></p>
this gets the placeholder value into the form but as it’s disabled your form then uses the textarea for the update - seems to be working for me..
(I also added style="hidden")