shadiadiph Posted October 12, 2013 Share Posted October 12, 2013 Hi probably a simple answer but this is driving me nuts <script> function subform(ifrm,name,email) { var ifrm = document.getElementById(""+ifrm); //alert(name); ifrm.contentWindow.document.forms[0].elements[name].value = 'James'; ifrm.contentWindow.document.forms[0].elements[email].value = '[email protected]'; //ifrm.contentWindow.document.forms[0].submit.click(); } window.onload = subform('adrian1','Name','Email'); </script> This script is filling in a form it only works if i alert(name); if i don't it does not work?? am i missing something or do i need to declare the name differently for example name value could be Name or FName or LName email could be Email e_mail Thanks in advance Link to comment https://forums.phpfreaks.com/topic/282902-javascript-working-if-i-alert-first/ Share on other sites More sharing options...
shadiadiph Posted October 12, 2013 Author Share Posted October 12, 2013 no problem i solved it Link to comment https://forums.phpfreaks.com/topic/282902-javascript-working-if-i-alert-first/#findComment-1453628 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.