I'm setting up a simple contact form but would like to fill in default value for one question based on the value of another field.
First off, I have added a required profile field labeled "CustomerID". Then in my Dynamic Form I have added a question short name "DealerID" which I have set in "Advanced Field Options" to "DotNetNuke User Default" = "CustomerID". The plan is that once the form is working correctly, this DealerID field will become a hidden field that the user doesn't see
The field that I want to fill in using SQL is the short name "ServiceRepEmail" field. Ideally, I would like this field to be a textbox, but I can only get the "Question Options" to come up if I use list box, radio buttons or combo box. For now, I am just using the list box type so that I can experiment with the SQL options.
On to the SQL statement. I have a view set up in the DNN database called vDealers. If I put in this SQL statement ...
select Parts_Rep_Email as QuestionOption from vDealers where ID = '105'
... everything works fine. It returns my single listing. However, if I set the SQL statement to ...
select Parts_Rep_Email as QuestionOption from vDealers where ID = $(DealerID)
... I get an error in SQL message. So my questions are:
1. How do you reference a shortname form field within a SQL statement?
2. Is there a way to use a SQL select statement to fill in the default value for a textbox? Or is that only available with some of the other question types?
Thanks,
Sheldon