How to assign specific id and name to hidden_field_tag ?
Like this,
hidden_field_tag(:id => "page_no",:name => "page", :value => "1" )
Any Idea!
hidden_field_tag("page_name", "1", :id => "page_no")
per http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-hidden_field_tag
It takes hidden_field_tag(name, value = nil, options = {})
So the third parameter is for options.
hidden_field_tag("page", "1", {:id => "page_no"})
would set name to "page", value to "1" and id to "page_no"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With