horseatingweeds Posted August 31, 2007 Share Posted August 31, 2007 For crying out loud. I've been working on this script to populate check boxes after validation and if the user uses an EDIT button. It kept dropping the first chk element And I could not find out why. I turned the hidden elements holding the the array returned from the chkbox array ass a string into text inputs so I could see what was going on. Well, it started working. I changes them to hidden with a css class position absolute -800 -800. Anyone else have this problem with hidden elements or know what this is all about? Quote Link to comment https://forums.phpfreaks.com/topic/67497-hidden-elements-causing-chk-box-problems/ Share on other sites More sharing options...
Ken2k7 Posted August 31, 2007 Share Posted August 31, 2007 Could you post like a code? Quote Link to comment https://forums.phpfreaks.com/topic/67497-hidden-elements-causing-chk-box-problems/#findComment-338898 Share on other sites More sharing options...
horseatingweeds Posted September 1, 2007 Author Share Posted September 1, 2007 I thought the question was more abstract Ken2k7. Does anyone know why a hidden element would wanker a script? here is an example though, part of it anyway: $array = spliti("\|", $_POST['activities']); foreach($array AS $activity) { switch ($activity) { case 'Doberman Puppies': GLOBAL $pup; $pup = "checked='checked'"; break; case 'Adult Dobermans': GLOBAL $adult; $adult = "checked='checked'"; break; case 'Trained Dobermans': GLOBAL $trained; $trained = "checked='checked'"; break; case 'Stud Service': GLOBAL $stud; $stud = "checked='checked'"; break; case 'Doberman Rescue': GLOBAL $rescue; $rescue = "checked='checked'"; break; } } There are 5 chk elements respective to each case. If the $_POST data comes from a hidden element every time it runs the first $activity goes away, and thus the first checked element shows unchecked. Quote Link to comment https://forums.phpfreaks.com/topic/67497-hidden-elements-causing-chk-box-problems/#findComment-338997 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.