I have a Wufoo form that I wanted to populate one of the fields with a value directly from the query string
the normal jQuery call for this does not get anything back
jQuery("#Field13")
so, all set using this, is just not accomplish
jQuery("#Field13").val( my_qs_value );
I'm using the Embed Javascript code from Wufoo (not the iframe), and the free account, I'm also using jQuery and not the dollar sign for calling the jQuery methods.
Any idea in what can I try? Or is there a setup that can place this by default?
Edited
From Chris answer I got everything to work, in the Wufoo javascript code I added the defaultValues
parameter that would call a method returning the information I needed.
'defaultValues':'Field13=' + getQuerystring('pname',''),
and the getQuerystring method I took it from Blogging Developer site:
function getQuerystring(key, default_)
{
if (default_==null) default_="";
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
if(qs == null)
return default_;
else
return qs[1];
}
We can't access the Wufoo iFrame as it's wufoo domain and all tries will end up with a cross-domain error call. This is the best solution and the Wufoo way of doing it.