PDA

View Full Version : Having problems with this form script


unclele
02-16-2003, 06:11 AM
I'm having problems with the required .rec file being attached to the data when an e-mail is sent to my address and am wondering if the form action is correct? I'm also wondering if the data sent to me can be in another format other than postdata.att? I've struggled over the form action code. I'm trying to make sure the fields are selected and sent in the form when submitted.


FORM ACTION="mailto:mardukeaom@cox.net?action=*.rec=&UPLOADFILE2&Hdr=&VolumeId=4886&PostingId=&OutlineId=0" onSubmit="return document.FileUpload.submit('document.forms[0]',this,validate())" method="post">
<input type="hidden" name="form1" value="&lt;img src=&quot;http://members.cox.net/mardukeaom/aom/img/616.gif&quot; height=15 width=15 border=0 alt=&quot;AOM File&quot;&gt;">

<center>
<!--
<i>Attaching uploaded files to posting [] by : </i><br>
-->
<!--
<i>Attaching uploaded files to folder [] </i><br>
-->

<script LANGUAGE="javaScript">
<!--

function validate(){
var docontinue;
var numPlayers;
docontinue = 1;
docontinue = CheckText(document.forms[0].Description, "The Description field must be filled out!");
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].strvalue1, "The Game Type field must be filled out!"); }
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].strvalue2, "The Game Type II field must be filled out!"); }
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].strvalue3, "The Map field must be filled out!"); }

// Force player 1
docontinue = CheckText(document.forms[0].row1_xstrvalue1,"The Name field for player 1 must be filled out.");

// Check Player Fields
numPlayers = 0;

if ( docontinue == true) {
if (document.forms[0].row1_xstrvalue1.value != "") {
docontinue = CheckSelection(document.forms[0].row1_xstrvalue2,"The Faction field for player 1 must be filled out.");
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].row1_xstrvalue3,"The Color field for player 1 must be filled out."); }
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].row1_xstrvalue4,"The Team field for player 1 must be filled out."); }
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].row1_xstrvalue5,"The Result for player 1 field must be filled out."); }
numPlayers = numPlayers + 1;
}
</script>


And this is the link to the site that the script is in:
Recorded Games Upload (http://members.cox.net/mardukeaom/aom/recordedgames.html)

unclele
02-16-2003, 07:42 PM
Maybe I asked too much in what I first typed and I need to be more specific.

My problem is the correct action code for my form I have no idea if its correct. I'm trying to upload a specific file (*.rec) and the text from the selections a guest or member selects. With the script as is I get the text (in postdata.att format) but not file is uploaded. Would possibly my applet code be wrong?
The current one is suppose to be this (I think)

action code:
__________________________________________________

FORM ACTION="mailto:mardukeaom@cox.net?action=&UPLOADFILE2&Hdr=&VolumeId=4886&PostingId=&OutlineId=0" onSubmit="return document.FileUpload.submit('document.forms[0]',this,validate())" method="post">
___________________________________________________

The codes script is setup like below:
___________________________________________________

function validate(){
var docontinue;
var numPlayers;
docontinue = 1;
docontinue = CheckText(document.forms[0].Description, "The Description field must be filled out!");
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].strvalue1, "The Game Type field must be filled out!"); }
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].strvalue2, "The Game Type II field must be filled out!"); }
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].strvalue3, "The Map field must be filled out!"); }

// Force player 1
docontinue = CheckText(document.forms[0].row1_xstrvalue1,"The Name field for player 1 must be filled out.");

// Check Player Fields
numPlayers = 0;

if ( docontinue == true) {
if (document.forms[0].row1_xstrvalue1.value != "") {
docontinue = CheckSelection(document.forms[0].row1_xstrvalue2,"The Faction field for player 1 must be filled out.");
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].row1_xstrvalue3,"The Color field for player 1 must be filled out."); }
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].row1_xstrvalue4,"The Team field for player 1 must be filled out."); }
if ( docontinue == true) { docontinue = CheckSelection(document.forms[0].row1_xstrvalue5,"The Result for player 1 field must be filled out."); }
numPlayers = numPlayers + 1;
}
_________________________________________________