I am showing the value in the textbox.The value comes from the databse first I store it in the variable.I have three radio buttons and when the user click third radio button the textbox going to be disabled.At the time I want to hide the textbox value displayed within the textbox.But not to set NULL.How can I do Using Jquery?
A:
Why won't you save current value attribute to a variable and then set input.value property to empty string ?
eugeneK
2009-10-31 14:25:14
Becausewhen the user click the previous radio button it displays that stored value in that textbox.
vinothkumar
2009-10-31 14:29:51
A:
How about 1. disabling it the normal way (.disabled = true) and then giving the textbox a "transparent" text color?
Pekka
2009-10-31 14:36:05
+1
A:
You could use a hidden field to store the value that you create on the fly:
$("#thirdRadioId").click(function(){
$("#textInputId").after('<input type="hidden" value="' + $("#textInputId").val() + '" />').val("").attr("disabled", "disabled");
});
You would have to build some functionality to undo this if the user then selects a different radio button.
jeerose
2009-10-31 14:56:58
Thank you very much Now I got the answer by using your way Thanks Thanks alot...
vinothkumar
2009-10-31 15:18:30