Adding radio groups to existing products_insert.php and update page
I am trying to create a radio group in my existing products_insert.php and update pages where depending on which radio button is checked the according value is then entered into the DB table.
In one example the database table is “ProductSubCat_Hound_Leash_LengthID” and the radio group labels and values are:
Short = 1
Medium = 2
Long = 3
Adjustable = 4
My Radio Group in the products_insert.php page is:
<label>
<input type="radio" name="LeashLength" value="1" id="LeashLength_0" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("productsinsert","ProductSubCat_Hound_Leash_LengthID"):""),"1"))) {echo "checked=\"checked\"";} ?>>
Short</label>
<br>
<label>
<input type="radio" name="LeashLength" value="2" id="LeashLength_1" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("productsinsert","ProductSubCat_Hound_Leash_LengthID"):""),"1"))) {echo "checked=\"checked\"";} ?>>
Medium</label>
<br>
<label>
<input type="radio" name="LeashLength" value="3" id="LeashLength_2" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("productsinsert","ProductSubCat_Hound_Leash_LengthID"):""),"1"))) {echo "checked=\"checked\"";} ?>>
Long</label>
<br>
<label>
<input type="radio" name="LeashLength" value="4" id="LeashLength_3" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("productsinsert","ProductSubCat_Hound_Leash_LengthID"):""),"1"))) {echo "checked=\"checked\"";} ?>>
Adjustable</label>
The Binding for the column “ProductSubCat_Hound_Leash_LengthID” in the Server Behavior “Insert Record (products) are set to:
<?php echo ((isset($_POST["ProductSubCat_Hound_Leash_LengthID"]))?$_POST["ProductSubCat_Hound_Leash_LengthID"]:""); ?>
The values are not entered into the DB table. I have never done this and can’t figure out what I am missing here. Is there anything else that I have to do besides the binding in the server behavior or am I way off with this?
Any help is greatly appreciated.
Best,
AJ