How to turn 17 forms into 1, with a dynamic field based on b

Posted by Community Admin on 03-Aug-2018 18:13

How to turn 17 forms into 1, with a dynamic field based on breadcrumb?

All Replies

Posted by Community Admin on 27-Sep-2012 00:00

Sitefinity 5.1.3450.0, on Azure (web and sql).

I have 17 forms, one for each location.  The forms are all identical in terms of fields.  The only difference is the location the user fills out the form for.

Name:
Email:
Phone:
Comment:

The same fields for all forms...but I want a "Location:" field that automatically populates the form based on the breadcrumb so one form can be used for all locations with the "Location:" spot automatically filled out.

Name:
Email:
Phone:
Comment: 
Location:  *from breadcrumb* /locations/Kansas-City/

Is this possible? 

Posted by Community Admin on 28-Sep-2012 00:00

Totally :)
1) Put on a new layout where you want the location to exist, edit it, and give it a wrapper class name
2) Drop a textbox in there, call it location
3) Use jquery to grab\form the location (get the url, or breadcrumb, or wherever)
4) Place that jquery data into the location box.

So when they submit, it goes into the DB as if they typed it.

To make it "Hidden", just CSS the wrapper div class you made above into a display:none

Done!

This thread is closed