Inserting check box
Is there a tutorial on how to insert a checkbox into an existing .php page and recording this into a database.
I have looked but cannot locate one.
Thank you
John
Is there a tutorial on how to insert a checkbox into an existing .php page and recording this into a database.
I have looked but cannot locate one.
Thank you
John
There is no tutorial for it, but it should be very simple to figure out.
Just add the checkbox using Insert->Form->Checkbox where you want it to appear.
Then double click on your database insert server behavior to bind the checkbox to the column where you want it recorded, or add an insert server behavior if you don't already have one.
Thanks Ray,
That helped a lot.
I cannot get the result to show in the database field
The field is tinyint - length1 - allow null.
Can you see where the code is incorrect in the attached document?
What is the column name you added? Is it saved properly in the database? What table did you add the column to? I need more information to analyze what might be wrong.
Column Name: ContactPermission
Added to table named Boats
It is the last field in the table.
Is it saved properly in the database? Yes as far as I can tell.
ContactPermission - tinyint
Length1
Decimals 0
Allow Null
I forgot to mention it is on localhost at the moment.
I think your checkbox would just be:
<input name="ContactPermission" type="checkbox" id="ContactPermission" value="1" />
It looks like your columns are in the wrong order. Your columns have: MeasureInLOA, MeasureInBeam, ContactPermission
but your values have:
GetSQLValueString($_POST['LOA_Measure'], "text"),
GetSQLValueString($_POST['ContactPermission'], "tinyint"),
GetSQLValueString($_POST['Beam_Measure'], "text"));
It would have to match the order from above like:
GetSQLValueString($_POST['LOA_Measure'], "text"),
GetSQLValueString($_POST['Beam_Measure'], "text"),
GetSQLValueString($_POST['ContactPermission'], "tinyint"));
Many thanks Ray.
That solved the problem!
Cheers
John
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.