Adding an hidden input field to Form block using custom template
Permalink
Hi,
I want to submit a hidden input field in my Form block so that the data can be viewed under Reports in the back-end.
Now, when adding a Form block I see no option of making a field hidden - so I am investigating whether this is possible using a custom template for the Form block.
Ive successfully added a custom template by copying the default template to my /blocks/form/templates directory - and in the default template I see this:
This is the code responsible for outputting the questions/input fields. How do I modify the survey object to add a new field dynamically?
Is there maybe another approach I could look at? Thanks! :)
I want to submit a hidden input field in my Form block so that the data can be viewed under Reports in the back-end.
Now, when adding a Form block I see no option of making a field hidden - so I am investigating whether this is possible using a custom template for the Form block.
Ive successfully added a custom template by copying the default template to my /blocks/form/templates directory - and in the default template I see this:
<?php $miniSurvey->loadSurvey( $survey->questionSetId, 0, intval($bID) ); ?>
This is the code responsible for outputting the questions/input fields. How do I modify the survey object to add a new field dynamically?
Is there maybe another approach I could look at? Thanks! :)
Hi!
Thanks for replying! Well, I tend to simplify posts to forums as my experience is the more non-essentials you put in there, the less people bother reading the post.
In any case, I know my stuff and could figure it out if I looked at the Form block controller - but I thought this requirement might not be that uncommon - so lazyness prevailed and I threw a question up ;)
So... Bring on da knowledge! More complicated, the better!
Thanks again :)
Thanks for replying! Well, I tend to simplify posts to forums as my experience is the more non-essentials you put in there, the less people bother reading the post.
In any case, I know my stuff and could figure it out if I looked at the Form block controller - but I thought this requirement might not be that uncommon - so lazyness prevailed and I threw a question up ;)
So... Bring on da knowledge! More complicated, the better!
Thanks again :)
There are a couple different things you can do, but it depends on your coding experience. Considering you were able to pick out the form rendering script, you obviously have some PHP know-how. Are you familiar with OOP?