tags:

views:

1097

answers:

1

I have a custom button that calls the saveRow function. I want to put a url specific to the click of the button, but the url parameter must not be right. Here is the code to my custom button:

send = "<input name='send' class='tweetbuttons' id='tbuttonSend"+cl+
       "' type='button' value='Send' "+
       "onclick=jQuery('#list2').saveRow("+cl+",function(){alert('made_it_here')},item_send.php,{submitType:send}); /><br />";

While watching the Console in FireBug, I see an error: "item_send is not defined". I could not find any examples for the url parameter, and I tried putting my url in a variable. Any ideas?

+1  A: 

Ok, here is the answer. Hopefully this helps someone out there, but I am eating crow since I caused it. Here is what is needed. Since my row id is not a number but a string (2 pieces of information with a dash in the middle), quotes are needed around the id (c1) parameter in the saveRow function. Secondly, single quotes are needed around the edit url parameter in the saveRow function call.

send = "<input name='send' class='tweetbuttons' id='tbuttonSend"+cl+
       "' type='button' value='Send' "+
       "onclick=jQuery('#list2').saveRow('"+cl+"',function(){alert('made_it_here')},'item_send.php',{submitType:send}); /><br />";

That did the trick for me. Let us know if that helps.

dwaz