I create a button dynamically on the page,using "<input type='button'
id="btnOk" onclick=fSubmit('add') value="Add"/>"

now, i wanna let the button to trigger the fSubmit function with
another argument "update",that is fSubmit('update'),and set it's value
to 'Update'.

i did it like this:
$("btnOk").value="Update";
$("btnOk").abserve("click",function(){fSubmit("update")});

it works!!But there's one problem puzzling me.
I click the button,it firstly trigger fSubmit('add'),and later
fSubmit('update').But my purpose is to trigger fSubmit('update')....

Why?
And how can i reach my purpose?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to