I've made a simple mailing list form nested in a div layer floating in the corner of the screen. its basically just a text field and submit button. is it possible to hide the div layer that the form is in, when the user clicks submit?
here is the code for the form:
Code:<!-- newsletter subscribe below here --> <script language="Javascript" type="text/javascript"> var fieldstocheck = new Array(); fieldnames = new Array(); function checkform() { for (i=0;i<fieldstocheck.length;i++) { if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "") { alert("Please enter your "+fieldnames[i]); eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()"); return false; } } return true; } function addFieldToCheck(value,name) { fieldstocheck[fieldstocheck.length] = value; fieldnames[fieldnames.length] = name; } </script> <form method="post" action="http://www.mydomain.com/lists/?p=subscribe&id=1" name="subscribeform"> Email:<input type="text" name="email" value = ""><br> <script language="Javascript" type="text/javascript">addFieldToCheck("email","Email Address");</script> Name: <input type="text" name="attribute2" value = ""> <script language="Javascript" type="text/javascript">addFieldToCheck("attribute2","Name");</script> <input type="hidden" name="list[1]" value="signup" /> <input type="submit" name="subscribe" value="Subscribe" onClick="return checkform();"> </form> <!-- newsletter subscribe ends here -->



Reply With Quote

Bookmarks