phpforsilk Posted June 25, 2008 Share Posted June 25, 2008 Hello PHP Gurus - I have a php form that has some validation code within it that I can't seem to figure out why it isn't working on a particular server. http://www.fidus.com/test/pcb_layout_form.php - the form emails results and returns the "thankyou page" but it doesn't recognize the validation script on the particular server it is on. I have tested it on another server and it works. Can anyone help? Not sure what else you require in order to review the issue, so please advise. Thanks so much - I am pulling my hair out to firgure this out. Thanks! Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted June 25, 2008 Share Posted June 25, 2008 You have to post your script here for us to see. Without seeing your script it's hard for us to determine what is wrong. Please surround your code with tags. Ken Quote Link to comment Share on other sites More sharing options...
revraz Posted June 25, 2008 Share Posted June 25, 2008 Your PHP.INI files are probably different, so you use a feature (register globals perhaps) on one and not the other. Quote Link to comment Share on other sites More sharing options...
phpforsilk Posted June 25, 2008 Author Share Posted June 25, 2008 Thank you - here is the code. <script language="JavaScript" type="text/javascript"> function validate() { if (document.forms['form1'].elements['FirstName'].value == "") { alert("Please enter your first name"); return false; } if (document.forms['form1'].elements['LastName'].value == "") { alert("Please enter your last name"); return false; } if (document.forms['form1'].elements['CompanyName'].value == "") { alert("Please enter your Company name"); return false; } if (document.forms['form1'].elements['Add1'].value == "") { alert("Please enter your address"); return false; } if (document.forms['form1'].elements['City'].value == "") { alert("Please enter your city"); return false; } if (document.forms['form1'].elements['ProvState'].value == "") { alert("Please enter your Province/State"); return false; } if (document.forms['form1'].elements['Country'].value == "") { alert("Please enter your Country"); return false; } if (document.forms['form1'].elements['Telephone'].value == "") { alert("Please enter your Phone Number"); return false; } if (document.forms['form1'].elements['Email'].value == "") { alert("Please enter your Email address"); return false; } if (document.forms['form1'].elements['New Design'].value == "") { alert("Please enter your Project Scope"); return false; } if (document.forms['form1'].elements['Pins'].value == "") { alert("Please enter your number of Pins"); return false; } if (document.forms['form1'].elements['Parts'].value == "") { alert("Please enter your number of components"); return false; } if (document.forms['form1'].elements['Nets'].value == "") { alert("Please enter your number of Nets"); return false; } if (document.forms['form1'].elements['layers'].value == "") { alert("Please enter your number of layers"); return false; } if (document.forms['form1'].elements['counts'].value == "") { alert("Please enter your signal layer count"); return false; } return true ; } </script> </head> <table cellspacing="0" cellpadding="0"> <tr> <td align="center"><a href="/index.php" class="headerlinks"><b>Home</b></a> | <a href="/contactus.php" class="headerlinks"><b>Contact Us</b></a> | <a href="/sitemap.php" class="headerlinks"><b>Site Map</b></a> <br /> <br /> <div align="center"><form name="form1" id="form1" style="padding:0px; margin:0px;"> <select name="menu1" onchange="MM_jumpMenu('parent',this,0)" style="border: solid #6C8DAC 1px; background: #FFFFFF; color: #76777A; font-size:10px;"> <option selected="selected" style="color:#101C44;">I need to know . . .</option> <option value="/expertise.php">What do you do?</option> <option value="/Company/choosefidus.php">Why Fidus?</option> <option value="/careers.php">Are you hiring?</option> <option value="/contactus.php">How can I contact you?</option> <option value="/search.php">I'd like to search for...</option> <option value="mailto:info@fidus.com">The answer to my question is not here ...</option> <option value="mailto:Feedback@fidus.com?subject=A suggestion for Fidus">Fidus suggestion box</option> </select> </form> <form name="form1" form action="FormToEmail.php" method="post" onsubmit="return validate()"> <p align="left" class="style1"><strong>PCB Layout Quote Form </strong></p> <table border="1" cellspacing="0" cellpadding="0" width="571"> Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted June 25, 2008 Share Posted June 25, 2008 I don't see any PHP in the posted code. This looks like a Javascript problem. I will move this to the Javascript section unless the OP shows us that it is a PHP problem. Ken Quote Link to comment Share on other sites More sharing options...
phpforsilk Posted June 25, 2008 Author Share Posted June 25, 2008 Thanks, I'll review it in that section - hopefully someone will be able to assist. Sorry to bug. Cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.