[TYPO3-project-seminars] Preselect a status value
Alexander Grein
ag at mediaessenz.eu
Thu Sep 24 15:21:42 CEST 2009
Hi,
in an earlier post i had the problem to change the labels of the status
formfield.
I found a way to do it:
plugin.tx_onetimeaccount_pi1 {
form.elements.status.data.items {
10 >
40 >
50 >
}
_LOCAL_LANG {
default {
label_status = Legal insurance protection**
label_status.I.1 = Yes
label_status.I.2 = No
}
}
}
Now i need to preselect the value "Yes".
At the moment i get this output:
...
<dt>
<label for="tx_onetimeaccount_pi1_form_status" class="required">Legal
insurance protection**</label>
</dt>
<dd class="tx-onetimeaccount-pi1-status">
<select name="tx_onetimeaccount_pi1_form[status]"
id="tx_onetimeaccount_pi1_form_status">
<option value="1" >Yes</option>
<option value="2" >No</option>
</select>
</dd>
...
But i need this (with "selected="selected""):
...
<dt>
<label for="tx_onetimeaccount_pi1_form_status" class="required">Legal
insurance protection**</label>
</dt>
<dd class="tx-onetimeaccount-pi1-status">
<select name="tx_onetimeaccount_pi1_form[status]"
id="tx_onetimeaccount_pi1_form_status">
<option value="1" selected="selected">Yes</option>
<option value="2" >No</option>
</select>
</dd>
...
I already looked in the formable documentation
(http://formidable.typo3.ug/reference/elements/renderlet.html) and tried
this:
plugin.tx_onetimeaccount_pi1.form.elements.status.data.defaultValue = 1
But there is no change in the outputed html code.
I am happy for every hint, how to do this.
I use formidable 1.1.0 and onetimeaccount 0.6.1 together with seminars 0.7.4
Alex
More information about the TYPO3-project-seminars
mailing list