tags:

views:

47

answers:

2

I want to restrict user to enter values in textbox at particular button click otherwise set disabled false. If I set $("#txtquery").attr("disabled","disabled"); it sets text box to blank. I want to retain the text if readonly is toggled.

+3  A: 
$('#txtquery').attr('readonly', 'readonly');
Darin Dimitrov
Thanks for the answer
Dee
You're welcome.
Darin Dimitrov
Thanks! Been scratching my head over this... I thought it was ASP.Net fucking this up...
Peter
A: 

Just use:

$('#txtquery').attr('readonly', 'readonly');

to disallow further editing.

Sarfraz