Setting the value for a hidden field in a survey

I created a new survey and set one of the custom field's visibility to "Hidden". Now I am trying to set that form field to the hash value from the url like this: mydomain.com/surveys/rs261t5r1x8ac#valueineedtoset. I have looked at the apps/frontend/controllers/SurveyController.php but I don't see how it is possible to add the value from there. I have also looked through several other source files and I have not been able to find where the sql table gets updated so I can do this. Any help or pointers in the right direction would be greatly appreciated.
 

twisted1919

Administrator
Staff member
Did you try to append the field in the query string of the url, like:
mydomain.com/surveys/rs261t5r1x8ac?CUSTOM_FIELD_NAME=my-value
?
 
I figured out the field name is not the label value, it is the field number like "field-9". So setting that in the query string works only if the field is set to visible. When I try setting it to hidden and I inspect the code on the survey page it doesn't show any <input type="hidden"...> other than the csrf_token. Is the survey not setup to handle hidden fields?
 
Last edited:

twisted1919

Administrator
Staff member
@WinnersEdgeMarketing - it seems by design we never show those fields if they are hidden, so instead of making them inputs with the hidden attribute, we simply don't display them at all.
We will correct this for the next release so we render the fields in the page but just hide them via the style attribute.
 
Top