You can use FormSet to set a textField value, but it doesn't work for radio buttons or checkboxes.
For example, this code...
[{FormOpen form='FormTestRadioButton'}]
[{FormSet form='FormTestRadioButton' textfieldRB='OK' rb='2'}]
[{FormInput type='text' name='textfieldRB' }]\\
[{FormInput type='radio' name='rb' value='1'}] Value 1\\
[{FormInput type='radio' name='rb' value='2'}] Value 2\\
[{FormInput type='radio' name='rb' value='3'}] Value 3
[{FormClose}]
...produces this form:
(The Value 2 is not checked)
Now an example with check boxes.
This code...
[{FormOpen form='FormTestCheckBox'}]
[{FormSet form='FormTestCheckBox' textfieldCB='OK too' cb2='checked'}]
[{FormInput type='text' name='textfieldCB' }]\\
[{FormInput type='checkbox' name='cb1' value='1'}] Value 1\\
[{FormInput type='checkbox' name='cb2' value='2'}] Value 2
[{FormClose}]
...produces this form:
(Value 2 is not checked)
Any solution will be welcome
-MRA 12 Oct 2008
This should work:
[{FormOpen form='FormTestCheckBox'}]
[{FormSet form='FormTestCheckBox' textfieldCB='OK too'}]
[{FormInput type='text' name='textfieldCB' }]\\
[{FormInput type='checkbox' name='cb1' value='1'}] Value 1\\
[{FormInput type='checkbox' name='cb2' value='2' checked=true}] Value 2
[{FormClose}]
No, no, I mean by using just the FormSet, as it is done for the textfield. :-)
--MRA
Does any one knows how to get input value in text box in a variable. I want to use that in form open stmt . In below code $var must contain value entered in textbox hellotext.
[{FormOpen form='sprform' hide='onsuccess' method='post' submit='http://someurl?n=[{$var}]'}]
input [{FormInput type='text' name='hellotext'}]
[{FormInput type='submit' value='Submit, please' name='submit'}]
[{FormClose}]