dasein Posted March 21, 2009 Share Posted March 21, 2009 Hi, I've got an email that gets sent out with an embedded form in it. On the form are text boxes and radio buttons. Both present information read from a database correctly. The email allows the recipient to modify any informations and hit the SUBMIT button to modify the information back in the database. If I modify something in one of the textboxes, it makes the correct change (the info in passed along fine). But all the radio buttons are passing as 'on' when, in fact, some are not 'on' or ''....driving me nuts trying to find the fault. The information is either stored as YES or NO in the db. Below is a sample from the form where $row[6] contains YES or NO. That's being read okay. If I click the NO button on the form in the email, unlike the textbox, it isn't passing that to the processing php script. All radios are sent as 'on' for some reason. Thanks...I appreciate any heads-up on this. if($row[6]=="YES") { $emailmessage = $emailmessage . "<input type=\"radio\" name=\"newvalue\" CHECKED>YES "; $emailmessage = $emailmessage . "<input type=\"radio\" name=\"newvalue\">NO</td></tr>"; } else { $emailmessage = $emailmessage . "<input type=\"radio\" name=\"newvalue\">YES "; $emailmessage = $emailmessage . "<input type=\"radio\" name=\"newvalue\" CHECKED>NO</td></tr>"; } Quote Link to comment https://forums.phpfreaks.com/topic/150486-solved-passing-radio-values-from-embedded-email-message-to-php-processing-script/ Share on other sites More sharing options...
MadTechie Posted March 21, 2009 Share Posted March 21, 2009 try adding a value $emailmessage = $emailmessage . "<input type=\"radio\" name=\"newvalue\" value=\"YES\" CHECKED>YES "; $emailmessage = $emailmessage . "<input type=\"radio\" name=\"newvalue\" value=\"NO\" >NO</td></tr>"; Quote Link to comment https://forums.phpfreaks.com/topic/150486-solved-passing-radio-values-from-embedded-email-message-to-php-processing-script/#findComment-790582 Share on other sites More sharing options...
dasein Posted March 21, 2009 Author Share Posted March 21, 2009 Thanks...I was playing around and did just that. When there was no value listed at all, the reads from the database were correct, but on submission from the email form, all radio buttons were given an 'on' value. When I then listed a value exactly as you did here, all radio buttons were given an 'off' value on submission. I can't figure or trace what's going on here. Quote Link to comment https://forums.phpfreaks.com/topic/150486-solved-passing-radio-values-from-embedded-email-message-to-php-processing-script/#findComment-790590 Share on other sites More sharing options...
MadTechie Posted March 22, 2009 Share Posted March 22, 2009 can you post the code that check what radio box is choosen Quote Link to comment https://forums.phpfreaks.com/topic/150486-solved-passing-radio-values-from-embedded-email-message-to-php-processing-script/#findComment-790602 Share on other sites More sharing options...
dasein Posted March 22, 2009 Author Share Posted March 22, 2009 Hey, in putting together what you asked for, I just realized my dumb mistake. I was improperly testing the passed variable for =='on' when in fact it was being passed =='YES' or 'NO'. I knew it was a dumb mistake somewhere, but collecting the code parts brought it out...so thanks! Quote Link to comment https://forums.phpfreaks.com/topic/150486-solved-passing-radio-values-from-embedded-email-message-to-php-processing-script/#findComment-790610 Share on other sites More sharing options...
MadTechie Posted March 22, 2009 Share Posted March 22, 2009 I thought it would be something like that, solved ? (if so please click solved) Quote Link to comment https://forums.phpfreaks.com/topic/150486-solved-passing-radio-values-from-embedded-email-message-to-php-processing-script/#findComment-790739 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.