views:

49

answers:

3
<label>Do you want to accept American Express?</label>
Yes<input id="amex" style="width: 20px;" type='radio' name='Contact0_AmericanExpress' value='1'/>  
No<input style="width: 20px;" type='radio' name='Contact0_AmericanExpress' class='check' value='0' checked="checked"/>

The radio button does not show up as checked by default. I started off without a default choice doing some very simple js validation and it wasn't working. So I opted to just use default values until I figured that out and discovered that something weird is going on.

The markup is valid and I've tried in FF, Safari and Chrome. Nothing works.

I think it's a conflict with the JQuery library because the problem goes away when I remove the call script.

A: 

Just copied your code into: http://jsfiddle.net/fY4F9/

No is checked by default. Do you have any javascript running that would effect the radio box?

Ben Rowe
I know, it's crazy right? No I don't have any scripts going that address radio buttons. Just some validation on text fields and a slider script. I'm going thru it right now just to make sure though..
Jordan
Found the culprit but I don't know exactly what in that script is causing the problem
Jordan
Also try in a browser with a cleared cache. Just in case
Ben Rowe
Thanks Ben but it's definitely the script. When disabled I can see the buttons checked by default.
Jordan
Actually I think it's a conflict with the JQuery library
Jordan
A: 

You're using non-standard xhtml code (values should be framed with double quotes, not single quotes)

Try this:

<form>
  <label>Do you want to accept American Express?</label>
  Yes<input id="amex" style="width: 20px;" type="radio" name="Contact0_AmericanExpress"  />  
  No<input style="width: 20px;" type="radio" name="Contact0_AmericanExpress" class="check" checked="checked" />
</form>
CFP
@cfp thats's up to Jordan's doc type. regardless of that it'll still work in a xhtml doctype; it won't validate however.
Ben Rowe
I changed it just for kicks but I know that isn't the problem. Validation is nice but it won't solve this one.
Jordan
A: 

Your code is right, try to debug your JQuery script to find the issue! If you're using FF you can install an extension to debug JS (and JQuery) it's called FireBug!

Cheers

thePanz