MrDean
MrDean

Reputation: 305

Clear gridview using javascript/jquery

Afternoon all.

Another hour, another question!

I have the following bit of jquery up and running that essentially 'resets' control contents.

tbxProdAC.Attributes.Add ("onclick", "$('#txtbxHowMany').val(''); SetRadioFocus('" + radProd.ClientID + "');");

I have a gridview that pops up occasionally (don't worry, I have got that bit under control!) so what I would like to do is amend the above code so that when I click on txtProdAC, GridView1 is removed.

Further to this, how would one implement a checked/unchecked function with jquery i.e. if tbxProdAC was click, radiobutton1 is unchecked?

Again, as always, apologies for my ignorance.

Upvotes: 0

Views: 15219

Answers (2)

MBahamondes
MBahamondes

Reputation: 360

Try this:

$("tbxProdAC").click(function(){
    //id gridview ending with 'GridView'
    $("table[id$='GridView']").html("");
});

Regards

Upvotes: 0

IEnumerator
IEnumerator

Reputation: 2972

$("#tbxProdAC").click(function(){

    $('#GridView1').remove(); // or .toggle() to show/hide
    $("#" + radProd.ClientID).attr("checked",false);

});

Upvotes: 2

Related Questions