aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes required fields not populating Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "required fields not populating" Watch "required fields not populating" New topic
Author

required fields not populating

Larikus Scott
Greenhorn

Joined: Feb 05, 2006
Posts: 2
I have a form that isnt populating. I go to the webmail to check the form and i get the upload that people send but the data from the forms is not populating. Here is the code. What is wrong?

<HTML>

<HEAD>

<TITLE>Quarter-Life Crisis: Submit Now!</TITLE>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

<link href="style.css" rel="stylesheet" type="text/css">

<script language="JavaScript" type="text/JavaScript">

<!--
function checkemail(fromemail)
{
var result = false;
var newStr = new String(fromemail);
var index = newStr.indexOf("@");
if (index > 0)
{
var pindex = newStr.indexOf(".",index);
if ((pindex > index+1) && (newStr.length > pindex+2))
result = true;
}
return result;
}
function evalid()

{

if (document.form1.fromname.value=="")

{

alert('Please Enter your Name');

document.form1.fromname.focus();

return false;

}

if (document.form1.fromemail.value==0)
{
alert('Please Enter the Email Address');
document.form1.fromemail.value="";
document.form1.fromemail.focus();
return false;
}
var eemail1= document.form1.fromemail.value;
if(!checkemail(eemail1))
{
alert("Please Enter a valid E-mail Address");
document.form1.fromemail.focus();
//document.form1.Email.value="";
return false;
}

if (document.form1.address.value=="")

{

alert('Please Enter your Address');

document.form1.address.focus();

return false;

}

if (document.form1.age.value=="")

{

alert('Please Enter your Age');

document.form1.age.focus();

return false;

}

if( !(form1.chkTerms.checked) )

{

alert("Please Accept the terms and conditions.");

return false;

}

return true;

}

//-->

</script>

<style type="text/css">

<!--

.style1 {color: #FF0000}

-->

</style>

</HEAD>

<BODY BGCOLOR=759ABA LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<!-- ImageReady Slices (design2.psd) -->

<TABLE WIDTH=779 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>

<TR>

<TD bgcolor="#FFFFFF">

<table width="779" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="353"><IMG SRC="images/header_01.jpg" WIDTH=353 HEIGHT=101 ALT=""></td>

<td><table border="0" cellspacing="0" cellpadding="0">

<tr>

<td height="73" background="images/header_black_bg.jpg"><div align="right"><a href="index.html" class="blacklink">Home</a><span class="blackfont"> |</span> <a href="aboutus.html" class="blacklink">About Us</a><span class="blackfont"> |</span> <a href="contactus.html" class="blacklink">Contact Us</a>    </div></td>

</tr>

<tr>

<td><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>

<TR>

<TD> <a href="index.html"><IMG SRC="images/header_03.jpg" ALT="" WIDTH=109 HEIGHT=28 border="0"></a></TD>

<TD> <a href="aboutus.html"><IMG SRC="images/header_04.jpg" ALT="" WIDTH=103 HEIGHT=28 border="0"></a></TD>

<TD> <a href="submission.html"><IMG SRC="images/header_05.jpg" ALT="" WIDTH=103 HEIGHT=28 border="0"></a></TD>

<TD> <a href="questions.html"><IMG SRC="images/header_06.jpg" ALT="" WIDTH=111 HEIGHT=28 border="0"></a></TD>

</TR>

</TABLE></td>

</tr>

</table></td>

</tr>

</table></TD>

</TR>

<TR>

<TD width="779" height="25" background="images/header_gray_bg.jpg"><div align="right"><br>

<strong><font color="#666666" size="3" face="Arial, Helvetica, sans-serif"><em>     </em></font></strong></div></TD>

</TR>

<TR>

<TD height="4" background="images/black_line_bg.jpg"><img src="images/black_line_bg.jpg" width="4" height="4"></TD>

</TR>

<TR>

<TD bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td height="10" colspan="2" bgcolor="#FFFFFF"> </td>

</tr>

<tr valign="top">

<td width="208" bgcolor="#FFFFFF"><TABLE BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>

<TR>

<TD> <IMG SRC="images/tab_red_07.gif" WIDTH=10 HEIGHT=10 ALT=""></TD>

<TD> <IMG SRC="images/tab_red_08.gif" WIDTH=183 HEIGHT=10 ALT=""></TD>

<TD> <IMG SRC="images/tab_red_09.gif" WIDTH=10 HEIGHT=10 ALT=""></TD>

</TR>

<TR>

<TD background="images/red_bg.jpg">  </TD>

<TD background="images/red_bg.jpg">

<br> <table width="100%" border="0" cellspacing="1" cellpadding="1">

<tr>
<td><img src="images/arrow.gif" width="9" height="9"></td>
<td><a href="index.html" class="blacklink">Crisis?</a> </td>
</tr>
<tr>
<td><img src="images/arrow.gif" width="9" height="9"></td>
<td><a href="Whyarewedoingthis.html" class="blacklink">The Idea</a> </td>
</tr>
<tr>
<td><img src="images/arrow.gif" width="9" height="9"></td>
<td><a href="whatarewedoing.html" class="blacklink">What?</a></td>
</tr>
<tr>
<td><img src="images/arrow.gif" width="9" height="9"></td>
<td> <span class="blacklink"><a href="Whoarewelookingfor.html" class="blacklink">Who?</a> </span></td>
</tr>
<tr>
<td><img src="images/arrow.gif" width="9" height="9"></td>
<td><span class="blacklink"><a href="aboutus.html" class="blacklink">About Us</a></span></td>
</tr>
<tr>
<td><img src="images/arrow.gif" width="9" height="9"></td>
<td><span class="blacklink"><a href="whenshouldyousubmitby.html" class="blacklink">Submission Deadline</a> </span></td>
</tr>
<tr>
<td><img src="images/arrow.gif" width="9" height="9"></td>
<td height="40"><span class="blacklink"><a href="submission.html" class="blacklink"><strong>SUBMISSION FORM</strong></a></span></td>
</tr>

</table> <p> </p> <p><br>

<br>

<br>

<br>

<br>

<br>

<br>

<br>

</p>

<p> </p> </TD>

<TD background="images/red_bg.jpg">  </TD>

</TR>

<TR>

<TD> <span class="blacklink"><IMG SRC="images/tab_red_17.gif" WIDTH=10 HEIGHT=11 ALT=""></span></TD>

<TD> <span class="blacklink"><IMG SRC="images/tab_red_18.gif" WIDTH=183 HEIGHT=11 ALT=""></span></TD>

<TD> <span class="blacklink"><IMG SRC="images/tab_red_19.gif" WIDTH=10 HEIGHT=11 ALT=""></span></TD>

</TR>

</TABLE></td>

<td width="571" bgcolor="#FFFFFF"><table width="571" border="0" cellspacing="0" cellpadding="0">

<tr>

<td><table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/bar_bg.gif">

<tr>

<td width="20"><img src="images/bar_left.gif" width="20" height="25"></td>

<td><img src="images/title_submission.gif" width="87" height="25"></td>

</tr>

</table></td>

</tr>

<tr>

<td> </td>

</tr>

<tr>

<td><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td class="black12"><p><strong>Please submit your piece below. Each individual may submit up to three pieces of nonfiction prose, poetry, artwork or photography.</strong><br>

</p>

<p class="style1">Submit a maximum of ten pages (12 point Times New Roman font, single-spaced, one-inch margins) for each piece of nonfiction prose.</p>

<p>Pieces of poetry should be submitted in the authors intended publication font and format. Only black and white artwork and/or photography will be allowed and each piece should be one page maximum. All pieces that exceed the page limit will be disregarded. <br>

<p>Please note that a maximum of two files may be submitted with each completed submission form. To submit a third piece, please fill out a second submission form and attach the file. <br>

<br>

<font color="#FF0000"><strong>* Fields are mandatory</strong></font><br>

<br>

</p>

</td>

</tr>

<tr>

<td class="black12">

<table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="759ABA">

<form action="submissionform1.php" enctype="multipart/form-data" method="post" name="form1" onSubmit="return evalid();"><tr>

<td width="42%" height="25" bgcolor="B3CDE8" class="black12"><div align="left"><strong>Full Name: <font color="#FF0000">*</font></strong></div></td>

<td width="58%" class="blackfont"> 

<input name="fromname" type="text" id="fromname" size="30">

</td>

</tr>

<tr>

<td height="25" bgcolor="B3CDE8" class="black12"><div align="left"><strong>Email: <font color="#FF0000">*</font></strong></div></td>

<td class="blackfont"> 

<input name="fromemail" type="text" id="fromemail" size="30">

 </td>

</tr>

<tr>

<td height="25" bgcolor="B3CDE8" class="black12"><div align="left"><strong>Address (Street, City, State/Country, Zip/Postal Code): <font color="#FF0000">*</font></strong></div></td>

<td class="blackfont"> 

<textarea name="address" cols="30" rows="3" id="address"></textarea>

</td>

</tr>

<tr>

<td height="25" bgcolor="B3CDE8" class="black12"><div align="left"><strong>Telephone Number: </strong></div></td>

<td class="blackfont"> 

<input name="telephone_number" type="text" id="telephone_number"></td>

</tr>

<tr>

<td height="25" bgcolor="B3CDE8" class="black12"><div align="left"><strong>Age: <font color="#FF0000">*</font></strong></div></td>

<td class="blackfont"> 

<input name="age" type="text" id="age" size="5"></td>

</tr>

<tr>

<td height="25" bgcolor="B3CDE8" class="black12"><div align="left"><strong>Sex: </strong></div></td>

<td class="blackfont">

<table width="200" border="0" cellpadding="0" cellspacing="0">

<tr>

<td width="25%"><div align="center">

<input name="radiobutton" type="radio" value="male">

</div></td>

<td width="25%" class="black12">Male</td>

<td width="25%" class="black12"><div align="center">

<input name="radiobutton" type="radio" value="female">

</div></td>

<td width="25%" class="black12">Female</td>

</tr>

</table></td>

</tr>

<tr>

<td bgcolor="B3CDE8" class="black12"><div align="left"><strong>Upload
File: <br>
</strong> <font color="#FF0000" face="MS Sans Serif">(If you
have your file - please attach) </font></div></td>

<td height="70" class="blackfont"> 
<input type="file" name="file1">
<br>
<br>
 
<input type="file" name="file2">
</td>

</tr>

<tr>

<td colspan="2" class="blackfont"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td valign="top"><span class="regi_tbtxt">

<input name="chkTerms" type="Checkbox" value="Register" unchecked>

</span></td>

<td><p class="black12">By checking this box and submitting your piece to this publication, you are in agreement with the above terms. </p></td>

</tr>

</table></td>

</tr>

<tr>

<td height="25"><div align="right" class="blackfont">

<input name="subject" type="hidden" value="Quarter-Life-Crisis.com Submission Form">

<input type="submit" name="Submit" value="Submit">

  </div></td>

<td class="blackfont"> 

<input type="reset" name="Submit2" value="Reset"></td></tr>

<tr>

<td height="25" colspan="2"><p class="black12">* By submitting this piece to Quarter-Life-Crisis.com, you affirm its authenticity as an original piece created by you (the artist or writer) and relinquish all ownerships rights to the piece. The piece becomes the possession of Quarter-Life-Crisis.com and cannot be published in any form during our period of publication. You agree to grant to Quarter-Life-Crisis.com exclusive worldwide English language rights to publish, distribute, edit and sell your work. However, your name will always appear in conjunction with your work. After the publication period, all unpublished works will be returned to their originator and Quarter-Life-Crisis.com shall relinquish all rights to the said piece. If your piece is selected for publication, Quarter-Life-Crisis.com will notify you in writing. After the publication period, Quarter-Life-Crisis.com relinquishes all rights to pieces not selected for publication.
</tr></form>

</table> </td>

</tr>

</table> <p class="black12"> </p> </td>

</tr>

</table></td>

</tr>

<tr>

<td height="10" colspan="2" bgcolor="#FFFFFF"> </td>

</tr>

</table></TD>

</TR>

<TR>

<TD height="20" bgcolor="B3CDE8"><div align="center"><span class="blacklink"><a href="index.html" class="blacklink">Home</a></span><span class="blackfont"> |</span><span class="blacklink"> <a href="aboutus.html" class="blacklink">About Us</a> </span><span class="blackfont">|</span><span class="blacklink"> <a href="submission.html" class="blacklink">Submission</a> </span><span class="blackfont">|</span><span class="blacklink"> <a href="questions.html" class="blacklink">Questions</a> </span><span class="blackfont">|</span><span class="blacklink"> <a href="contactus.html" class="blacklink">Contact Us</a> <br>

</span></div></TD>

</TR>

<TR>

<TD height="20" bgcolor="B3CDE8"><div align="center"><span class="blackfont">© Copyright www.quarter-life-crisis.com 2005. All rights reserved</span></div></TD>

</TR>
</TABLE>

<span class="blacklink"><!-- End ImageReady Slices -->

</span></BODY>

</HTML>
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You CAN NOT have a form inside of a table like that.

this is wrong


this is correct


Now where is it breaking, In the client or the server. You need to debug this to find out where. Put checks on the client (alerts) and on the server tosee if the data is getting to where it is supposed to. Maybe your validation is clearing the fields or maybe your server has wrong field names.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: required fields not populating