0

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();  
      alert(name);
      //var guest = '<span>'+name+'</span><br>';
      var guest = '<input type="text" class="input-name" value='+name+' name="GName[]" size="45" readonly><br>';
      $("#anothertable").append(guest);
      $(newrow).unbind("click");
   });
});

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?

TIA!

1
Contributor
1
Reply
11
Views
3 Years
Discussion Span
Last Post by nadiam
0

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.

TIA!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.