Php help - Auction code


I am trying to fix up my auction site and I am stuck on 1 issue and I was hoping maybe somebody can help me out.

Basically the below piece of code shows up on the edit auction page of the site. Here users will edit their auction fields, so if they originally selected “Pay Pal” as a form of payment, it should still be checked in the edit auction page and changes can be made.

The problems I am having is with shipping conditions. For some strange reason whatever is selected during auction setup isn’t prefilled when going to edit the auction. Once you enter the edit auction page ALL the shipping conditions remain blank and the user will have to re-select the one he wants all the time. The condition he selected when setting up the auction should be checked when entering the edit auction page.

I am hoping it’s just something silly that is missed in the code. The code does show “checked” so it should work, but for some reason it doesn’t.

Hopefully somebody can help me out. Any help is appreciated :D

Here is the code:

case "radio": $radio_arr=explode("|",$field["D3_int_value"]); foreach($radio_arr as $value) { $val=explode("+",$value); if(count($val)<=1) $field_str.="<tr><td><input type='".$field["D3_type"]."' value='".$val[0]."' name='".$field["D3_name"]."'> ".$val[0]."</td></tr>"; else $field_str.="<tr><td><input type='".$field["D3_type"]."' value='".$val[1]."' name='".$field["D3_name"]."' checked> ".$val[1]."</td></tr>"; }

Don’t know if this will actually solve the problem, but at least it will make the code easier to read:

[php]case “radio”:
$radio_arr=explode("|", $field[“D3_int_value”]);
foreach($radio_arr as $value)
$val=explode("+", $value);
if(count($val) <= 1)
$field_str .= "

" . $val[0]."";
$field_str.=" " . $val[1] . “”;
} [/php]

Those lines are automatically word wrapping. But if they were in an actual code editor they would automatically line up nicely with the previous lines.

Sounds like your HTML is messing up. What’s the doctype? I seem to remember that XHTML strict only allows ’ checked=“checked” ’ forms to check a checkbox. And be adviced that there’s also the ’ selected=“selected” ’ variant for some of the form elements.

See Input Tags for more information. Also see the W3C Validator to check your HTML output for any problems.

Sponsor our Newsletter | Privacy Policy | Terms of Service