Hi. I can change the value of a simple text field using onFormReady in the form embed code, but can't figure out how to use the same code to select an option from a dropdown. Can anyone help?
This works for a text field:
hbspt.forms.create({
portalId: "xxxx",
formId: "xxxxx",
css: "",
onFormReady: function($form) {
$('input[name="firstname"]').val("Dave").change();
But this does not work for a dropdown:
hbspt.forms.create({
portalId: "xxxx",
formId: "xxxxx",
css: "",
onFormReady: function($form) {
$('input[name="dropdown"]').val("option1").change();
The field is definitely named correctly and the internal values match up with what I'm trying to select. Any ideas?