You need to sign in to do that
Don't have an account?
Danesh
Library to convert SF Fields into HTML input fields
Does anyone know of a library that converts SF fields into HTML elements? I want to build an HTML form for Contacts but I'd like to do it more dynamically. I'm iterating over all of the fields returned from the GET request so I'd like to generate the form on the fly, not hard-code it.
For example, the name fields are text field, so I'd like it to generate an input tag with type=text. If my Contact has a picklist, I'd like the form to render a select tag.
Ideally, I'd like a gem for Ruby on Rails but any library will help for now.
For example, the name fields are text field, so I'd like it to generate an input tag with type=text. If my Contact has a picklist, I'd like the form to render a select tag.
Ideally, I'd like a gem for Ruby on Rails but any library will help for now.
https://mindfiresfdcprofessionals.wordpress.com/tag/visual-force-equivalent-html-code/
I'm not looking for converting VF to HTML. I've parsed the result of calling the request, "..../sobjects/Contact/describe", so I know the type of each field. I'd like something that maps that to an HTML field.
For example, here's a textarea's result
Ideally, the library would take that in and spit out an HTML text area with length 255, name specified, etc etc.
My current solution is to use this form builder (http://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html) and just handle the "type" with a case/switch statement, then spit out the right one. That's just a bit manual :/