How to pass a field from simple_form as a hidden div value

Hi folks
  Im trying to pass a value to my hidden div using simple_form but im
not sure how to do this, was wondering if anyone could help me with
this. Here is my view using simple_form

  <%= f.label "First name" %>
  <%= f.text_field :first_name %>

  <%= f.label "Last name" %>

  <%= f.text_field :last_name %>

  <%= f.input :full_name, :as => :hidden, :input_html => { :value =>
[:first_name, :last_name].join(' ') } %>

  <%= f.submit %>

If ive already got the first and last name from the input fields how can
i pass those values to the hidden div? This code above isnt working.
Thanks

You have to use Javascript for that.

Why do you want to do this anyway? If you just want to combine “First” and “Last” to one string “First Last”, do it when you receive the data in the controller or model.

Regards

Linus