Rob Myrick
Rob Myrick

Reputation: 859

Enable A Submit Button in Chrome

what is the proper way to ENABLE a form submit button in HTML? My form is currently disabled by Chrome and I need it to be enabled.

<div style="width:250px; float:left">
   <aside id="mailchimpsf_widget-2" class="widget widget_mailchimpsf_widget"><div class="widget-inner"> 

<div id="mc_signup">
<form method="post" action="#mc_signup" id="mc_signup_form">
    <input type="hidden" id="mc_submit_type" name="mc_submit_type" value="html" />
    <input type="hidden" name="mcsf_action" value="mc_submit_signup_form" />
    <input type="hidden" id="_mc_submit_signup_form_nonce" name="_mc_submit_signup_form_nonce" value="d0bc38cc04" />        

<div class="mc_form_inside">
    <div class="updated" id="mc_message"></div><!-- /mc_message -->


<div class="mc_merge_var">
<label for="mc_mv_EMAIL" class="mc_var_label">Email Address</label>
<input type="text" size="18" value="" name="mc_mv_EMAIL" id="mc_mv_EMAIL" class="mc_input"/>
</div><!-- /mc_merge_var -->

    <div class="mc_signup_submit">
        <input type="submit" name="mc_signup_submit" id="mc_signup_submit" value="Keep Me Updated!" class="button" />
    </div><!-- /mc_signup_submit -->

</div><!-- /mc_form_inside -->
</form><!-- /mc_signup_form -->
</div><!-- /mc_signup_container -->
</div></aside>
            </div> <!--Left Floated Div-->

This button is also disabled somehow in IE9. What is going on here? I've never had this problem with forms.

Thanks!

Upvotes: 1

Views: 1444

Answers (4)

Kovo
Kovo

Reputation: 1717

By default, it is always enabled. Are you placing this submit button inside of a <form> tag?

You most likely have something else on the page interfering with your submit button.

Doing a quick test, it seems it is not any of the css classes or ids.

I would first remove this script: <script type='text/javascript' src='http://www.endingpovertytogether.org/wp-content/plugins/mailchimp/js/mailch‌​imp.js?ver=1.2.10'></script>, and see if it fixes the no submit problem.

Upvotes: 2

Koerr
Koerr

Reputation: 15723

In endingpovertytogether.org's code:

<form method="post" action="#mc_signup" id="mc_signup_form" onSubmit="document.getElementById('submit').disabled=true;">
..
<input type="submit" name="mc_signup_submit" id="mc_signup_submit" value="Keep Me Updated!" class="button" />
</form>

Remove onSubmit="document.getElementById('submit').disabled=true;" in tag from

It's in script file:

<script type='text/javascript' src='http://www.endingpovertytogether.org/wp-content/plugins/mailchimp/js/mailch‌​imp.js?ver=1.2.10'></script>

Remove:

$('#mc_signup_submit').attr("disabled","disabled");

In function mc_beforeForm()

Upvotes: 1

Paul Aldred-Bann
Paul Aldred-Bann

Reputation: 6020

You can disable a submit button in markup (to enable it simply remove the attribute):

<input type="button" id="my-button" value="Button" disabled="disabled" />

Or you can do it in script:

// disable
document.getElementById("my-button").setAttribute("disabled", "disabled");

//enable
document.getElementById("my-button").removeAttribute("disabled");

However, html elements are always enabled by default so check whether you have any script setting input children of an element to disabled.

Upvotes: 1

earl3s
earl3s

Reputation: 2373

Is it inside a <form> tag? That could lead to a submit button being disabled. There is nothing to submit.

Upvotes: 0

Related Questions