/    Sign up×
Community /Pin to ProfileBookmark

Radio Button Killing Submit Button

Hi everyone! I’ve been racking my brain about this one almost all day. Perhaps a fresh set of eyes can help me on this. Below is the relevant part of the code. It’s a credit card form that eventually comes to the question, “Does your billing address match your shipping address?” with two radio buttons…Yes and No. Yes is checked by default. When No is clicked, a tad of JS displays the “billing_address” div. That works fine.

Here’s the problem…if the user gets to the radio buttons and leaves the default “Yes” checked and then clicks “Next>>”, everything works fine. However, if they click “No” the div appears…then they fill it out and when they click “Next>>” nothing happens. It just sits there. So…any ideas on why this might be happening? I mean, it’s the exact same submit button…the only difference is that this other div has popped up as a result of the “No” radio button being clicked.

I am still going over it trying to solve the problem…if anyone sees anything obvious, please let me know! Any help is MUCH appreciated! Thanks!

[code=html]
<br>
<br>
Does your billing address match your shipping address? <input type=”radio” name=”what_shipping” checked onclick=”billing_match = false ;$(‘billing_address’).style.display = ‘none’;”> Yes <input type=”radio” name=”what_shipping” onclick=”billing_match = true;$(‘billing_address’).style.display = ‘block’;”> No
<br>
<br>
<div style=”display: none;” id=”billing_address”>
Billing Address: <span class=”red” id=”billing_address_1_error”></span><br>
<input size=”40″ type=”text” name=”billing_address_1″ id=”billing_address_1″><br>
<input size=”40″ type=”text” name=”billing_address_2″ id=”billing_address_2″><br>

City: <span class=”red” id=”billing_city_error”></span><br>
<input size=”40″ type=”text” name=”billing_city” id=”billing_city” ><br>
<table cellpadding=”0″ cellspacing=”5″>
<tr>
<td valign=”top”>
State: <span class=”red” id=”billing_state_error”></span><br>
<input type=”hidden” id=”billing_full_state” name=”full_state”>
<select id=”billing_state” name=”billing_state”>
<option value=”” selected=”selected”>Select a State</option>
<option value=”AL”>Alabama</option>
<option value=”AK”>Alaska</option>
<option value=”AZ”>Arizona</option>
<option value=”AR”>Arkansas</option>
<option value=”CA”>California</option>
<option value=”CO”>Colorado</option>
<option value=”CT”>Connecticut</option>
<option value=”DE”>Delaware</option>
<option value=”FL”>Florida</option>
<option value=”GA”>Georgia</option>
<option value=”HI”>Hawaii</option>
<option value=”ID”>Idaho</option>
<option value=”IL”>Illinois</option>
<option value=”IN”>Indiana</option>
<option value=”IA”>Iowa</option>
<option value=”KS”>Kansas</option>
<option value=”KY”>Kentucky</option>
<option value=”LA”>Louisiana</option>
<option value=”ME”>Maine</option>
<option value=”MD”>Maryland</option>
<option value=”MA”>Massachusetts</option>
<option value=”MI”>Michigan</option>
<option value=”MN”>Minnesota</option>
<option value=”MS”>Mississippi</option>
<option value=”MO”>Missouri</option>
<option value=”MT”>Montana</option>
<option value=”NE”>Nebraska</option>
<option value=”NV”>Nevada</option>
<option value=”NH”>New Hampshire</option>
<option value=”NJ”>New Jersey</option>
<option value=”NM”>New Mexico</option>
<option value=”NY”>New York</option>
<option value=”NC”>North Carolina</option>
<option value=”ND”>North Dakota</option>
<option value=”OH”>Ohio</option>
<option value=”OK”>Oklahoma</option>
<option value=”OR”>Oregon</option>
<option value=”PA”>Pennsylvania</option>
<option value=”RI”>Rhode Island</option>
<option value=”SC”>South Carolina</option>
<option value=”SD”>South Dakota</option>
<option value=”TN”>Tennessee</option>
<option value=”TX”>Texas</option>
<option value=”UT”>Utah</option>
<option value=”VT”>Vermont</option>
<option value=”VA”>Virginia</option>
<option value=”WA”>Washington</option>
<option value=”WV”>West Virginia</option>
<option value=”WI”>Wisconsin</option>
<option value=”WY”>Wyoming</option>
</select>
</td>
<td valign=”top”>
Zip: <span class=”red” id=”billing_zip_error”></span><br>
<input size=”7″ type=”text” name=”billing__zip” id=”billing_zip”>
</td>
</tr>
</table>
</div>
<input onclick=”submit_order();” id=”submit_button_2″ type=”button” value=”Next >>”>
[/code]

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 19.2010 — Give a link or the full code
×

Success!

Help @UtopiaTheory spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...