Javascript – To disable onfocus=“this.blur();”

i am selecting values to my textbox from a popup window and i hav used
onfocus="this.blur();" for textbox, i want to disable this function in editbutton while i want to edit . i cant use readonly since the value is not passed to server due to postback,
pls help

Best Solution

You mentioned that you cannot use readonly because it is not submitted back during a POST back. Actually the readonly attribute, as in

<input ... readonly="readonly" />

is submitted back to the server during a POST. The disabled attribute, as in

<input ... disabled="disabled" />

is not submitted backing durring a POST.