There is no built in support in Sharepoint to dynamically populate a form field in a survey. We had a requirement where we wanted to pass in a querystring parameter to set the value for an input field in the survey. To solve this, I used the following approach :
- Create the survey with your field which you want populated through querystring. Don’t specify any default value.
- Browse to http://SPSServer/Lists/YourSurvey/NewForm.aspx
- Do a view source. Find the name of your input field new TextField(frm,”Field_x0020_Field_x0023_“,”Please enter code#”,””), where please enter code is your field label. Grab the stuff in red color for later use.
- Use Frontpage 2003 to connect to your sharepoint website. Go to Lists and you will find your survey there. Expand the survey folder and open Newform.aspx
- Paste below code just above the closing </form> tag
- Thats it. You should be able to populate the field by change the QueryStr value in the querystring.