Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

Form Problem

  • Please log in to reply




  • Member
  • PipPip
  • 76 posts
I have a javascript below that forces someone filling out the form to fill out all of the blanks before submitting and won't let them submit until they have filled it all out. The problem is that the end of it is conflicting with the

method="post" action="http://fp1.formmail..../cgi-bin/fm192"

part so that the form isn't submitting to our 3rd party site. Can anyone figure out how to fix this?

<script language="JavaScript">

function formCheck(formobj){
// Enter name of mandatory fields
var fieldRequired = Array("Name", "EMail", "ZipCode", "Topic", "Provider", "Comment");
// Enter field description to appear in the dialog box
var fieldDescription = Array("Name", "E-Mail", "Zip Code", "Topic", "Provider", "Comment/Question");
// dialog message
var alertMsg = "Please complete the following fields:\n";

var l_Msg = alertMsg.length;

for (var i = 0; i < fieldRequired.length; i++){
var obj = formobj.elements[fieldRequired[i]];
if (obj){
case "select-one":
if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
alertMsg += " - " + fieldDescription[i] + "\n";
case "select-multiple":
if (obj.selectedIndex == -1){
alertMsg += " - " + fieldDescription[i] + "\n";
case "text":
case "textarea":
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescription[i] + "\n";
if (obj.type == undefined){
var blnchecked = false;
for (var j = 0; j < obj.length; j++){
if (obj[j].checked){
blnchecked = true;
if (!blnchecked){
alertMsg += " - " + fieldDescription[i] + "\n";

if (alertMsg.length == l_Msg){
alert("Thank you for contacting us here at myFOXnepa.com!")
return false;
return false;
// -->

<form name="formcheck" onsubmit="return formCheck(this);" method="post" action="http://fp1.formmail....cgi-bin/fm192">
<input type="hidden" name="recipient" value="1" />
<input type="hidden" name="_pid" value="55940" />
<input type="hidden" name="_fid" value="H7ZA3PWK" />
<input type="hidden" name="print_config" value="email" />
<input type="hidden" name="subject" value="myFOXnepa.com Contact Us" />
<table width="200" border="0">
<td background="http://media.myfoxne...tactus_top.jpg" style="background-repeat:no-repeat; padding-left:15px"><span class='fontStyle1'>Contact Us</span> </td>
<td background="http://media.myfoxne...tus_middle.jpg" style="background-repeat: repeat-y"><table width="658" border="0" cellpadding="8" cellspacing="0">
<td width="124" align="right" nowrap><div align="center">Name:</div></td>
<td width="518"><input type="text" name="Name" size="50"></td>
<td align="right" nowrap><div align="center">E-Mail :</div></td>
<td><input name="EMail" type="text" id="EMail" size="50"></td>
<td align="right" nowrap><div align="center">Zip Code :</div></td>
<td><input name="ZipCode" type="text" id="ZipCode" size="5"></td>
<td align="right" valign="top" nowrap><div align="center">Topic:</div></td>
<select name="Topic" id="Topic">
<option value="Select" selected></option>
<option value="Sports">Sports</option>
<option value="Technical Issues">Technical Issues</option>
<option value="TV Programs">TV Programs</option>
<option value="Community Calendar">Community Calendar</option>
<option value="Website Issues/Questions">Website Issues/Questions</option>
<td align="right" valign="top" nowrap><div align="center">Provider:</div></td>
<select name="Provider" id="Provider">
<option value="Select" selected></option>
<option value="Adams">Adams</option>
<option value="Atlantic Broadband">Atlantic Broadband</option>
<option value="Bastress TV">Bastress TV</option>
<option value="Beaver Valley">Beaver Valley</option>
<option value="Blue Ridge">Blue Ridge</option>
<option value="Blue Mountain">Blue Mountain</option>
<option value="CATV">CATV</option>
<option value="Cebridge Connection">Cebridge Connection</option>
<option value="Cedar Run">Cedar Run</option>
<option value="Comcast">Comcast</option>
<option value="Community Cable">Community Cable</option>
<option value="D and E Communications">D and E Communications</option>
<option value="DirecTV">DirecTV</option>
<option value="Eagle Lake">Eagle Lake</option>
<option value="Eastville">Eastville</option>
<option value="Echo Star">Echo Star</option>
<option value="Hancock Video">Hancock Video</option>
<option value="Herr Cable">Herr Cable</option>
<option value="JC Cable">JC Cable</option>
<option value="Loganton TV">Loganton TV</option>
<option value="Metrocast">Metrocast</option>
<option value="Monument">Monument</option>
<option value="Nittany Media">Nittany Media</option>
<option value="North-Eastern PA Telephone Co.">North-Eastern PA Telephone Co.</option>
<option value="North Penn">North Penn</option>
<option value="Pikes Peak TV Association">Pikes Peak TV Association</option>
<option value="Retel">Retel</option>
<option value="Service Electric">Service Electric</option>
<option value="Shen Heights">Shen Heights</option>
<option value="Southside Service">Southside Service</option>
<option value="Time Warner">Time Warner</option>
<option value="Tylersville Community">Tylersville Community</option>
<option value="Wire Tele-View Corporation">Wire Tele-View Corporation</option>
<td align="right" nowrap><div align="center">Comment/Question :</div></td>
<td><textarea name="Comment" cols="60" rows="10" id="Comment"></textarea></td>
<td height="57" colspan="2" class="center"><div align="center">

<input type="submit" name="thebutton2" value="Submit Information" />
<input type="reset" value="Cancel" name="button2" />
</span><br />

  • 0


Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Make sure access permissions to fp1.formmail.com are okay. Your current hosting package must allow SMTP ( http://en.wikipedia....ansfer_Protocol ) to work. Otherwise, no email can be sent.

Try: method="get"

Using JavaScript is not very secure. Might look into the following:

Online form makers. Just follow the instructions for making it and uploading file(s).


Edited by Major Payne, 29 May 2009 - 03:33 PM.

  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP