asp.net - Clear Enabled textboxes in form using jquery -
I need to empty / reset text box values, when it is only readable = true or enabled = false. I used the reset function in my code but my code does not work
function reset form ($ form) {$ form.find ('input: text, input: password, input: file , Select '). Val (''); $ ("Input [type = 'hidden']", this) .each (function () {this.value = '';}); $ Form.find ('input: checkbox') .removeAttr ('check'). RemoveAttr ('selected'); } & Lt; ASP: Text Box ID = "Txacted" runat = "server" readonly = "true" />
any suggestions ..
I'm not sure what your reset function is doing to me because I condition
to read only
The check is not showing, but you can try: & lt; Given from your code:> :)
i.e. Use APIs; .prop
and check the status of the property or attribute:
The other hope is that your objective :)
If you are curious:
and this can be easy:
function reset form ($ form) {$ form.find ('Input : Text, input: password, input: file, select '). Val (''); $ ("Input [type = 'hidden']", this) .each (function () {if ($ (this) .prop ('readonly')) {// You can test with string ($) Prop ('read only') === "true" this.value = '';}}); $ Form.find ('input: checkbox') .removeAttr ('check'). RemoveAttr ('selected'); } & Lt; ASP: text box id = "txacted" runat = "server" readonly = "true" />
Comments
Post a Comment