populate a field in an iframe with query string
Is it possible to target a text field that is in a iframe.
Here is my code so far. Just cant seem to target the field inside the iframe.
thanks in advance any suggestions.
Code:
function getqueryString(){
var url=location.href;
if(url.split('?email=')[1]!=undefined) {
var qs=url.split('?email=')[1];
String.prototype.splitqueryString=function() {
return this.split(/[=+&]/);
}
top.frames["ifrm"].document.getElementById('EMAIL_FIELD').value=qs.splitqueryString();;
}
}
window.addEventListener?email=
window.addEventListener('load',getqueryString,false):
window.attachEvent('onload',getqueryString);
</script>