| Home » Categories » Multiple Categories |
How do I use drop down menus, checkboxes or radio buttons in forms? |
|
Article Number: 7 | Last Updated: Mon, Apr 9, 2012 at 2:02 AM
|
You can use any input type in registration and modify profile forms. Nothing special is needed as long as you use the correct field name (custom1 custom2 etc for registration forms and newcustom1 newcustom2 etc for modify profile forms) and make sure the field is allowed in the form (in the YNYY setting). This is just the same as using a normal text input. So for example the following would work in a registration form.
<input type="checkbox" name="custom1" value="Agreed">
The only thing that is also useful is to redisplay a setting already entered in case the form returns an error for example. We can use some simple PHP for that (the bit in bold).
Drop down menu
<select name="custom1">
<option value="Male" <?php if ($custom1=="Male") echo "selected"; ?> >Male</option>
<option value="Female" <?php if ($custom1=="Female") echo "selected"; ?> >Female</option>
</select>
Checkbox
<input type="checkbox" name="custom1" value="Agreed" <?php if ($custom1=="Agreed") echo "checked"; ?> >
Radio buttons
<input type="radio" name="custom1" value="Yes" <?php if ($custom1=="Yes") echo "checked"; ?> >
<input type="radio" name="custom1" value="No" <?php if ($custom1=="No") echo "checked"; ?> >
|
Attachments
There are no attachments for this article.
|
How can I create secure download links in Sitelok with Amazon S3?
Added on Mon, Aug 1, 2011
After installing Sitelok I can’t login to the control panel
Added on Sun, Aug 21, 2011
How can I set the characters allowed in passwords
Added on Tue, Aug 23, 2011
I am not receiving any address data when users are added via Paypal
Added on Tue, Sep 6, 2011
Using Sitelok with Freeway Pro
Added on Thu, Aug 16, 2012
Using Gmail in Sitelok
Added on Mon, Aug 29, 2011
Can I modify the code in Sitelok
Added on Mon, Aug 1, 2011
Do you have a trial or demo version of Sitelok
Added on Mon, Aug 1, 2011
Does Sitelok work with Paypal?
Added on Mon, Aug 1, 2011
I can’t save or browse email templates
Added on Mon, Aug 1, 2011
|

