Click to See Complete Forum and Search --> : Add automatic ref number to an input tag on a form
welshphoto
10-29-2009, 06:01 AM
Add automatic ref number to an input tag on a form
or any other method.
This is a part of the code I use for a form. An email is sent to me with the information in this order.
<input type="Text" name="fname"> FIRST NAME <font color ="#FF0000">*</font><br>
<input type="Text" name="lname"> LAST NAME <font color ="#FF0000">*</font><br>
<input type="Text" name="address"> ADDRESS <font color ="#FF0000">*</font><br>
Fred
Smith
1 Main St
Etc
I’ve purchased a third party programme that requires the format as follows.
T1: Fred
T2: Smith
T3: 1 main St
Etc
I would like the form to create the T numbers automatically and not inputted by the person sending the form.
I have a little HTML code experience
I hope this is possible
Thanks
Welshphoto
opifex
10-29-2009, 06:15 AM
that would be easiest done on the server side... ads the "T numbers" in front of the output for each affected line in your processing script.
welshphoto
10-29-2009, 08:15 AM
Thanks.
Will this be done with a script and placed on the server or is there a file on the server that's needed to be activated.
Welshphoto
opifex
10-29-2009, 03:09 PM
What is the "action" and "method" for you form? What does the program you bought do with the form data? How is the data processed?
Too much missing information to give any answers at this point.
welshphoto
10-30-2009, 01:21 PM
The third party programme is a database collator.
When the emails are received the entry files are opened as a batch into the collator. This programme will only recognise the emails fields prefixed with a T1, T2, T3 etc.
If I manually place the T prefix before each field our email system works OK.
We have approx 60 fields per email and we would expect approx 1000 emails so you can see we will not be able to do this manually.
The upload form is a simple input tag.
The part I’m looking for is how to add a prefix to the emails when they are received, is this via the form or server?
Any guidance would help.
Thanks
opifex
10-30-2009, 06:34 PM
ok.... and what is the script that processes the form? to send it to the collator?
there is a missing piece somewhere...
what is the "action" and "method" for the form? is it processed by a perl script a php script? something like this??
<form name="input" action="submitform.php" method="get">
Then the "submit.php" or whatever it is will process the inputs and send you a mail or send the info to a database or a text file or another program ...
It is in each line that is processing the inputs that need the "T" that you can add the "T" in the processing. How will depend on the processing script and we haven't seen that.
welshphoto
10-31-2009, 07:12 AM
Thanks for your time
I've included the full form
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
font-size: 36px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<script language="JavaScript">
function check1255167150(f){
// your form validation code may go here
if(!transInit(f)){ return false; }
}
</script>
<form action="http://www.swanseacameraclub.co.uk/cgi-bin/amp.cgi?process" enctype="multipart/form-data" method="post" style="display:inline;" onsubmit="return check1255167150(this);">
<p align="center" class="style1">This is just a test page </p>
<input type="Hidden" name="required" value="fname,lname,address1,town,country,email">
<input type="Hidden" name="id" value="1255167150">
<input type="Text" name="fname">
Fist Name <font color ="#FF0000">*</font><br>
<input type="Text" name="lname">
Last Name <font color ="#FF0000">*</font><br>
<input type="Text" name="T3">
Honors (MAX 3) <br>
<input type="Text" name="address1">
Address1 <font color ="#FF0000">*</font><br>
<input type="Text" name="T5">
Address2 <br>
<input type="Text" name="town">
Town/City <font color ="#FF0000">*</font><br>
<input type="Text" name="T7">
County/State/Region <br>
<input type="Text" name="T8">
Post Code/Zip <br>
<input type="Text" name="country">
Country <font color ="#FF0000">*</font><br>
<input type="Text" name="email">
E-MAIL <font color ="#FF0000">*</font><br>
<input type="Text" name="T11">
</p>
<p><font color ="#FF0000">* Indicates that this is a required field</font><br>
<textarea name="T12" cols="40" rows="6"></textarea>
</p>
<p><br>
GENERAL
<input type="File" name="FILE1">
--- IMAGE TITLE
<input type="Text" name="T14">
<br>
GENERAL
<input type="File" name="FILE2">
--- IMAGE TITLE
<input type="Text" name="T16">
<br>
GENERAL
<input type="File" name="FILE3">
--- IMAGE TITLE
<input type="Text" name="T18">
<br>
GENERAL
<input type="File" name="FILE4">
--- IMAGE TITLE
<input type="Text" name="T20">
<br>
<br>
<br>
<input type="Submit" value="Submit">
</p>
</form><br><br>
<script src="http://www.swanseacameraclub.co.uk/cgi-bin/amp.cgi?printjs=1255167150" language="JavaScript"></script>
</body>
</html>
Welshphoto
opifex
10-31-2009, 09:27 PM
The file "amp.cgi" needs to be addressed.
Since you bought the script from perlscriptsjavascripts.com, I would suggest that you use your "free support" from them to fix your problem.
There is no need to buy scripts like this, it's much more practical to write your own or adapt a free script to your needs.