This is my code and in this i wanna call a java script function on some condition like if a = 1 than call hi() function and a = 2 than call hello() function
<%= f.collection_select :ser_id, @ser, :id, :name, :prompt => true -%>
Javascript function are
function hi()
{
alert("hi");
}
function hello()
{
alert("hello");
}
So now give me some idea that how can i call these to function according to given condition.
Try :