简体   繁体   中英

Enabling a Textbox and making it editable

I have a textbox field displayed in my jsp file which looks always disabled and uneditable. I would like to have it enabled and editable on one condition.

So when the above condition is satisfied, I will save the page which save this field in DB. I would just like to have the text box enabled and the field editable. My code is as follows,

    <li class="Textbox"><input type="text"
                                            dojoType="dijit.form.NumberTextBox" name="field name"
                                                id="EDIT21" style="width: 45px;" size="4" maxlength="3"
                                            value="${value of an expression}"
                                            onchange="Config1.updateStatus();" required="true"
                                            constraints="{min:1,max:999}" 
                                            rangeMessage="<spring:message code='validation.' arguments='1,999' />" />
                                    </li>

There's nothing in that code that would cause the textbox to behave like that. It sounds like you've either got some javascript disabling the textbox, or some CSS that makes it appear as though it's disabled even though it's not. If it's Javascript, look for a line that sets the disabled property, such as

document.getElementById('EDIT21').disabled = true;

or

document.getElementbyId('EDIT21').contentEditable = false;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM