tags:

views:

84

answers:

3

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
Becausewhen the user click the previous radio button it displays that stored value in that textbox.
vinothkumar
A: 

How about 1. disabling it the normal way (.disabled = true) and then giving the textbox a "transparent" text color?

Pekka
+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
Thank you very much Now I got the answer by using your way Thanks Thanks alot...
vinothkumar