Create dynamic link in HTML snippet - link change based on form input value

Create dynamic link in HTML snippet - link change based on form input value

I need to create a page in CREATOR, where there is a form and a iframe below the form.
The iframe will show a picture so I need the link to be changed dynamically each time the field input (field name: ClassID) 
I added the form as usual, then add a HTML snippet right below the form.
In the HTML snippet, everytime I use input.ClassID (my field name), it will pop-up an error that "variable "ClassID" not defined".
I also tried to create a page variable named "ClassID", but I don't know how to set the value of this variable = input.ClassID.

Please help me in this case.
Appreciate your support