Can I add a radio button or check box
I would like to add a radio button or check box for the user to check if they would like to receive their newsletter by e-mail. Can I do this, and if so, how?
THANKS!
I would like to add a radio button or check box for the user to check if they would like to receive their newsletter by e-mail. Can I do this, and if so, how?
THANKS!
You would need to have DataAssist in order to modify the Insert Record behavior to store the value of the new check box or radio button.
You just need to add the checkbox or radio button to the registration form, make sure to give it a checked value.
In the users table, you need to add a new column.
Then Edit the insert record server behavior on the registration page to bind the new checkbox to the new database column so it's value will be stored.
Jason, I have added radio buttons to the User Registration page for receiving our newsletter. Also added the appropriate field to the database, and all works well.
The problem I am having is adding the same radio group to the user_Profile page in case the user wants to change and either receive or not receive our newsletter. What is happening is if the user changes their option from yes to no, or no to yes, it just erases the value in the database instead of changing the value to yes or no.
Also what needs to be done to show what the user has selected on their profile page.
I hope I explained the in enough detail.
I also would like to add the same radio group to the admin users_Update page.
Larry
make sure that you have given each radio button a checked value.
In design View, click the radio button, in the property inspector, edit the checked value option to the value that should be stored in the DB if that radio is checked.
to set the initial state, click the dynamic button in the property inspector, then click the lightning bolt next to Select Value Equal to and select the column that corresponds to the radio button from the recordest.
Jason,
Thank you very much, that worked perfect, after I figured out I had my database set up wrong. After making the needed corrections, that works perfect.
One more question please. How would I put a field on the users_profile page notifying the user if they are currently subscribe or not currently subscribed? Since now it is enter in the database correct.
Sorry for all the easy dumb questions, but I am still learning and the more I learn about the WebAssist products the easier it seems to manage this website.
Larry
for that you need to create a php if statement that evaluates the value being stored in the database.
<?php if($row_RecordsetName['SubscribeColumn'] == "<subscribe value>") { ?>
You are subscribed
<?php } else { ?>
you are not subscribed
<?php } ?>
Note, this is sample code. Substitute "RecordsetName", "SubscribeColumn" and "<subscribe value>" with the correct name for your recordset, the subscribe column and the subscribe value.
Hi Jason,
In the Bindings panel under the Recordset name is: subscribeYes The column name in the database is: subscribeYes And the value is: y.
So using those values with the php you provided as below, I get a parse error and the line listed for the parse error is the very last line of code in the page.
<?php if($row_SubscribeYes['SubscribeYes'] == "<y>") { ?>
You are subscribed
<?php } else { ?>
you are not subscribed
?>
Any ideas why I would get the parse error, and why way at the bottom of the page.
Larry
you say the rs name is "subscribeYes" and the column name is "subscribeYes" (lower Case leading "s")
PHP is case sensitive so the code should be:
<?php if($row_subscribeYes['subscribeYes'] == "y") { ?>
if that doesn't work paste the exact error into your response and include a copy of the page in a zip archive so I can see the exact line number.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.