views:

92

answers:

2

Good morning. By default, and i don't know why, when the page ends the rendering, i get the submit button disabled.

<input type="submit" class="buttonColor" disabled="disabled" id="MyMatrix_ctl10_Form_btnSubmit" value="Enviar" name="MyMatrix$ctl10$Form$btnSubmit">

I need some way to enable it, or else i can't submit the form.

How can i do it?

Thanks.

Edit: I only have access to the code of the render page.

+1  A: 

script to enable and disable button

  $(document).ready(EnableDisableButton(buttonid,'true'); 


    function EnableDisableButton(objid, isEnable) {
        if (isEnable==='true') {
            $('#' + objid).removeAttr("disabled");
        }
        else {
            $('#' + objid).attr("disabled", "true");
        }
    }

or if you don't want this solution just remove disble attribute

<input type="submit" class="buttonColor" id="MyMatrix_ctl10_Form_btnSubmit" value="Enviar" name="MyMatrix$ctl10$Form$btnSubmit">
Pranay Rana
Is is possible to remove that attribute with some javascript code? As i said in the edit, i only have access to the render page. ( portalrender.aspx)
Filipe Costa
try the script that i given in your code -- for that you should incluedu jquery javascript file. you can also find javascript for this easily
Pranay Rana
check this javascript : http://www.houseofscripts.com/scripts/javascripts/disablebm.htm
Pranay Rana
Thanks for your help pranay. It help me to find the solution quickly. :)
Filipe Costa
A: 

I'm assuming by the generated name and id on the input tag that this is ASP.NET. The most likely cause of the disabled button is that the codebehind for this page actually sets the Enabled state of the button to false.

This is probably to prevent someone submitting a form before all values are completed, so I guess there would be some other codebehind logic somewhere to re-enable the button.

colinramsay