hey guys. first, sorry about the vague question title i know that that is totally unacceptable but i just didnt know what the title of this thread should be. sorry(ashamed).

so the "issues" that i am having is regarding this script:

$("#table tr td").live("click", function(){
   var row = $(this).closest('tr').css('background', 'LightSlateGray');
   var newrow = $(this);
   $("#button").live("click", function(){
      var name = $(newrow).text();  
      //var guest = '<span>'+name+'</span><br>';
      var guest = '<input type="text" class="input-name" value='+name+' name="GName[]" size="45" readonly><br>';

what the "issues" are:
1. $(newrow).unbind("click"); doesn't seem to work or i'm just doing it totally wrong because it does not unbind. here i want to unbind what happens to $("#table tr td") like i want it to "unclick" but it doesn't.

  1. see var guest = <span></span>; the fullname of name is displayed. example in #table i have one row with name Miss Emma Watson this name(in full) is displayed in <span></span> as it should but when i test it out with <input> i only get "Miss" in the textbox. is it something in the code that i did not do correctly that messes it up?


i fixed the <input> problem, i didn't think things through with that one. now i have i still have the unbind problem.

how do i unclick a row that has been clicked? i googled around and unbind() seemed the easiest solution and even that i can't do. very frustrating.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.