Hi
I was trying to call a javascript function.I have text areas like
transfer_reason1
transfer_reason2 etc in each divs
div number is available as variable div_no in the page…How can I pass
the textarea content to the javascript…Below I tried like
get_primary_assignees_transfer_reason($(‘transfer_reason+eval(#{div_no}))’).value
)
How can I evaluate the above to get
get_primary_assignees_transfer_reason($(‘transfer_reason1’).value )
get_primary_assignees_transfer_reason($(‘transfer_reason2’).value ) etc
But not working.Please help
Hi
I was trying to call a javascript function.I have text areas like
transfer_reason1
transfer_reason2 etc in each divs
div number is available as variable div_no in the page…How can I pass
the textarea content to the javascript…Below I tried like
get_primary_assignees_transfer_reason($(‘transfer_reason+eval(#{div_no}))’).value
)
How can I evaluate the above to get
get_primary_assignees_transfer_reason($(‘transfer_reason1’).value )
get_primary_assignees_transfer_reason($(‘transfer_reason2’).value ) etc
But not working.Please help
Sijo
You’re mixing javascript with ruby as far as I can see.
You can’t ‘call’ js functions as long as your code runs on the server
(ruby code)
The js stuff (vars etc) is only available in the browser. Same goes for
dom object methods like value.
So div_no won’t be available to ruby.