Welcome to WebmasterWorld Guest from 18.104.22.168
The script has a drop down menu with options. I have like 20 options instead of the original 3 that the script was designed with so I'd like to display them in a table with radio buttons instead of the drop down menu.
The current script is set up like this:
$package_dropdown .= "<option value=\"$key\">" . $value['item_name'] . "</option>\n";
I changed it to look like this:
$package_dropdown .= "<input type=\"radio\" name=\"" . $value['item_name'] . "\" value=\"$key\">" . $value['item_name'] . "<br><br>\n";
and also to look like this:
$package_dropdown .= "<input type=\"radio\" name=\"$key\" value=\"" . $value['item_name'] . "\">" . $value['item_name'] . "<br><br>\n";
Neither worked for me.
This code is located on a self submitting form on a page called Order.php.
After submitting the dropdown menu and some text boxes it confirms all the form input then sends to paypal.
What I'm I doing wrong in the code above? If it's correct what could it be?
I have a feeling it's something to do with how the radio buttons are being submitted. I have very limited experience with radio buttons.
Thanks in advance.
A couple of things.
Just changing $package_dropdown .= "<option value... to $package_dropdown .= "<input type=\"radio\... isn't going to work.. but you know that already. You're trying to change this:
Then, as you redesign the form, each radio button will require a unique name. That's pretty easy to code.
Then, the part of the script that processes the form will need to be changed to process the radio buttons.
As much as I don't like saying it, a look at your entire script would be in order. Better check first with the mods before doing a code dump, though.
Until I got a little better at coding php, I would create my forms just as they would appear in a plain html document. Then I added the php code where it was needed.