In my RoR application, user selects an option from a popup and the selected value is passed to hidden fields found in my parent form.
The problem is when passing values containing html characters (e.g. <a href= ""> ) to the parent form.
In my popup, i have a link as follows which passes a value to the main form:
popup code:
<% @users.each do |user| %>
<%= link_to_function "PassValue", "sendValue('"+ user.location+ "')" %>
<% end %>
application.js:
function sendValue(location){
window.opener.document.getElementById('submission_user_attributes_location').value = location;
}
The location value retrieved form the database can contain html chars like '', and this is where my sendValue function is not working.
Please can someone help me on this.
Many many thanks in advance for your help :)