...

View Full Version : FrontPage help: form processing



HuntBay
04-17-2008, 08:34 PM
Hello Everybody!
I have a form that I need to have working properly. There are three things that I need to accomplish with hidden variables:
one variable (hidden) depends on one included on a pulldown on the form
another (hidden, also) has to be obtained from the actual date/time
the last one (guessed it? hidden) comes from a random number to create one unique record.

The problem is that this 3 variables are coming up blank on the confirmation email.

Thanks

Hunter

rmedek
04-17-2008, 08:57 PM
That is great and all, but no one will be able to help you until you show your code. ;)

HuntBay
04-17-2008, 10:18 PM
:rolleyes:Oops, I thought I had included it.

Here's the code:


<form language="JavaScript" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" s-email-format="TEXT/CSV" b-email-label-fields="FALSE" b-email-subject-from-field="FALSE" s-email-subject="Registration Form" s-date-format="&#37;Y-%m-%d" s-time-format="%H:%M:%S" s-builtin-fields="Date Time" u-confirmation-url="thanks.html" s-email-address="here@there.com" startspan U-File="test.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" U-File="test.xml" S-Format="XML" S-Label-Fields="TRUE" B-Reverse-Chronology="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" -->
<br>

<script language="javascript">
var dt=new Date()
var yr=dt.getFullYear().toString()
var mt=(dt.getMonth()+1).toString()
var dy=(dt.getDate()).toString()
var hr=(dt.getHours()).toString()
var mn=(dt.getMinutes()).toString()
var sc=(dt.getSeconds()).toString()
DATE=yr+"-"+mt+"-"+dy+" "+hr+":"+mn+":"+sc
CustID=parseInt(Math.random()*100000000000000000)
</script>

<table border="0" cellpadding="0" cellspacing="0" width="700">
<tbody><tr bordercolor="#FFFFFF">
<td width="134"><b>
<input type="hidden" name="ClientID" value="11234556">
<input type="hidden" name="Corporate" value="Company">
<input type="hidden" name="InquiryDate" value="<%=DATE%>">
<input type="hidden" name="CustID" value="<%=CustID%>">
<font face="Verdana, Arial, Helvetica" size="2">First
Name<font color="#FF0000">*</font></font></b></td>
<td width="13"></td>
<td width="541"><font color="#000000" size="3">
<input size="50" name="FirstName" maxlength="50" type="text">
</font></td>
<td width="0"></td>
</tr>
<tr bordercolor="#FFFFFF">
<td width="134">
<b>
<font face="Verdana, Arial, Helvetica" size="2">Last
Name<font color="#FF0000">*</font></font></b></td>
<td width="13"></td>
<td width="541"><font size="3">
<input size="50" name="LastName" maxlength="50" type="text"></font></td>
<td width="0"></td>
</tr>
<tr bordercolor="#FFFFFF">
<td width="134"><b>
<font face="Verdana, Arial, Helvetica" size="2">Address<font color="#FF0000">*</font></font></b></td>
<td width="13"></td>
<td width="541"><font size="3">
<input size="75" name="Address" maxlength="75" type="text">
</font></td>
<td width="0"></td>
</tr>
<tr bordercolor="#FFFFFF">
<td width="134"><b>
<font face="Verdana, Arial, Helvetica" size="2">State<font color="#FF0000">*</font></font></b></td>
<td width="13"></td>
<td width="541"><font size="3">
<input size="3" name="State" value="NJ" maxlength="2" type="text">
</font></td>
<td width="0"></td>
</tr>
<tr bordercolor="#FFFFFF">
<td width="134"><b>
<font face="Verdana, Arial, Helvetica" size="2">Day
Phone<font color="#FF0000">*</font> </font>
</b></td>
<td width="13"></td>
<td width="541"><font size="3">
<input size="10" name="Phonenumber" maxlength="10" type="text"></font></td>
<td width="0"></td>
</tr>
<tr bordercolor="#FFFFFF">
<td width="134"><b>
<font face="Verdana, Arial, Helvetica" size="2">Evening
Phone</font><font color="#FF0000" face="Verdana, Arial, Helvetica" size="2">*</font></b></td>
<td width="13"></td>
<td width="541"><font size="3">
<input size="10" name="Phonenumber2" maxlength="10" type="text"></font></td>
<td width="0"></td>
</tr>
<tr bordercolor="#FFFFFF">
<td width="134"><b>
<font face="Verdana, Arial, Helvetica" size="2">City<font color="#FF0000">*</font></font></b></td>
<td width="13"></td>
<td width="541"><font size="3">
<input size="50" name="City" maxlength="50" type="text"></font></td>
<td width="0"></td>
</tr>
<tr bordercolor="#FFFFFF">
<td width="134"><b>
<font face="Verdana, Arial, Helvetica" size="2">Zip
Code<font color="#FF0000">*</font></font></b></td>
<td width="13"></td>
<td width="541"><font size="3">
<input size="10" name="Zip" maxlength="10" type="text"></font></td>
<td width="0"></td>
</tr>
<tr bordercolor="#FFFFFF">
<td width="134"><b>
<font face="Verdana, Arial, Helvetica" size="2">Email<font color="#FF0000">*</font></font></b></td>
<td width="13"></td>
<td width="541"><font size="3">
<input size="75" maxlength="75" name="Email" type="text">
</font></td>
<td width="0"></td>
</tr>
</tbody></table>
<p>
<font face="Verdana, Arial, Helvetica" size="2">
How did you hear about us?</font><font face="Verdana, Arial, Helvetica" size="2"><font color="#ff0000">*</font>
<select name="Source" size="1" >
<option value="Select From The Following">Select From The Following</option>
<option value="Google">Google</option>
<option value="Yahoo">Yahoo</option>
<option value="MSN">MSN</option>
<option value="Other Source">Other (Please Specify Below)</option>
</select>
<br><br>
If you choose "Other",
please specify here </font><font face="Verdana, Arial, Helvetica" size="3">
<input name="OtherSource" size="35" type="text">
</font></p>
<p>
<font face="Verdana, Arial, Helvetica" size="2">
Campus: <font color="#ff0000">*</font>
<select name="CampusName" size="1" >
<option value="Select From The Following">Select From The Following</option>
<option value="New Jersey">New Jersey</option>
<option value="Alaska">Alaska</option>
</select><br><br>
<script>
if (CampusName=="New Jersey"){
CampusNum = "0001"
}
else
CampusNum="0002"
</script>
<font color="#000000">You are interested in: <font color="#ff0000">*</font></font>
<select name="ProgramofInterest" size="1">
<option value="Select From The Following">Select From The Following</option>
<option value="A">Option A</option>
<option value="B">Option B</option>
<option value="Other">Other (Please specify below)</option>
</select>
<p><font size="2"><b></b></font><font face="Verdana, Arial, Helvetica" size="2">Any
other questions, comments or suggestions:<br>
<textarea name="comments_suggestions" rows="5" cols="45"></textarea>
</font></p>
<p><font color="#ff0000" face="Verdana, Arial, Helvetica" size="2">*
Required field.<br>
</font></p>
<blockquote>
<pre><font face="Verdana, Arial, Helvetica" size="3"><input name="Send" value="Send Form" type="submit"></font></font><font face="Verdana, Arial, Helvetica" size="3"><input name="Rest" type="reset"></font></pre>
</blockquote>
</form>

rmedek
04-17-2008, 11:51 PM
This is totally not a HTML issue…most likely it's the code in your FrontPage script where the form is being submitted to.

But you really need to provide more information. What you've posted here is the HTML and parts of the Javascript that construct the form, but none of the code that processes the form, nor any info on the scripts that are parsing the "<&#37; stuff %>" tags within the form.

Is this a self-contained FrontPage form?

HuntBay
04-18-2008, 12:06 AM
That's all I have for now; a self contained form.

Let me explain me better, i.e. the value of one of the variables that I use on this form (CampusNum) depends on the CampusName one. Something similar is happening also to the InquiryDate and CustID variables: I can't find how to assign dynamic values to them.

Bottom line, I'm a newbie trying to do an expert-like job. :)
Hunter

rmedek
04-18-2008, 02:46 AM
Yes, but what language are you using? What is making the variables, processing the form? ASP? PHP? Javascript?

I know little to nothing about what proprietary code FrontPage spits out so you need to be as specific and detailed as possible so someone can help you.

HuntBay
04-18-2008, 03:06 AM
Honest answer: I don't know. I suppose this is javascript; that's what I see at the beginning of the scripts that I'm trying to make work. Whatever you see up there that's all I have on the test form.

HB

_Aerospace_Eng_
04-18-2008, 05:29 AM
Two of your hidden inputs don't need to hidden at all. Actually they don't even need to be inputs.

Stop using frontpage and get width the 21st century.

You need to use a server side language like PHP. PHP can do 2 of the 3 things you need done.

The only thing it can't do is change the hidden input on the fly however I'm guessing this can probably be done on the server side as well.

Here is the basic idea of how it works.

Your form submits to some php processing script. The php knows the value of the select menu so it creates a variable (this will replace your first hidden input).

PHP can also generate dates and time on the fly. This replaces your second hidden input.

Now the last hidden input you said is needed to generate unique records. You can do this by storing the data in a database and having an auto_increment field.

So the things you need be familiar with. Learn how PHP can handle post variables. Look into the PHP date() function. You will also need to know how to store data into a mysql database. There is a great tutorial here: http://www.tizag.com/mysqlTutorial/

HuntBay
04-18-2008, 11:39 PM
Thanks both rmedek and Aerospace Eng.

I understand your point of view but I'm stuck with FP. I do hate it but is what keeps the site alive until someone redesigns it properly.

I hoped I could do that with the help of Javascript... well as Snaglepuss: exit stage php.

Thanks again.

Hunter

rmedek
04-18-2008, 11:44 PM
Javascript isn't going to process the form…you need some sort of server-side action to do the work. I'm totally guessing here but I would say that FrontPage probably interacts with ASP at some level (both being Microsoft).

Either way, I'll move this to a different forum; perhaps it'll be better suited there. But keep in mind this is a coding forum; for dedicated FrontPage help you'd be better off looking in a FrontPage forum or contacting MS's tech support.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum