473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Unique form name each time submitted.

57
Hi again...

Does anyone out there know if there is a way of making a form subject unique each time it's sent??
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="mailto:email@work.com?subject=EnXXXX"
  2.  
The form is simply submitted via Email, i would like the subject as aboe (enXXXX) where XXXX is a number which increases by 1 each time the form is submitted.

I'm guessing it would simply reference an external file and update each time it's submitted, is this possible?? if so please share this knowledge with me...
Aug 13 '07 #1
9 2692
acoder
16,027 Expert Mod 8TB
If you want a completely unique subject, you will need to program something server-side using a database or a file to store the current number.

What server-side language (PHP, ASP, JSP, Coldfusion, Perl etc.) are you familiar with?
Aug 13 '07 #2
plumba
57
If you want a completely unique subject, you will need to program something server-side using a database or a file to store the current number.

What server-side language (PHP, ASP, JSP, Coldfusion, Perl etc.) are you familiar with?
F - none of the above....... Was kinda hoping I could get some type of Javascript or similar to do this for me.

Bascially it the first time it send the form 'it' (what ever it may be) or the form will reference a txt file which would contain, say the number '1'.
It would take this back and add it to the subject, then add 1 to the number taken from the text file and save back. So next time it references the text file it will see the number is 2 and do the same process so the txt file will only contain the last used number...

All i need to know is, what this mysterious 'it' is I'm talking about and how I can get 'it' to read a simple text file - bang the number into the subject then increment the number in the text file by for for next time.
Aug 13 '07 #3
epots9
1,351 Expert 1GB
F - none of the above....... Was kinda hoping I could get some type of Javascript or similar to do this for me.

Bascially it the first time it send the form 'it' (what ever it may be) or the form will reference a txt file which would contain, say the number '1'.
It would take this back and add it to the subject, then add 1 to the number taken from the text file and save back. So next time it references the text file it will see the number is 2 and do the same process so the txt file will only contain the last used number...

All i need to know is, what this mysterious 'it' is I'm talking about and how I can get 'it' to read a simple text file - bang the number into the subject then increment the number in the text file by for for next time.
javascript can not write to a text file, u could generate random numbers....but double or more can still appear.
Aug 13 '07 #4
plumba
57
javascript can not write to a text file, u could generate random numbers....but double or more can still appear.
Hmmmm....... although i guess the likely hood is low, it's still a chance I cant take as the contents of the form are being sent to a programmer who need the subject to be different each time or his program trips up...

PS just realised you're helping me on both my queries - Many thanks!!

What would be the alternative to this? any suggestions??
Aug 13 '07 #5
pbmods
5,821 Expert 4TB
Heya, plumba.

Here's one way to do it:
Expand|Select|Wrap|Line Numbers
  1. <form ... action="mailto:...?subject=" onsubmit="this.action += new Date().getTime(); return true;">
  2.  
Aug 13 '07 #6
plumba
57
Heya, plumba.

Here's one way to do it:
Expand|Select|Wrap|Line Numbers
  1. <form ... action="mailto:...?subject=" onsubmit="this.action += new Date().getTime(); return true;">
  2.  
If I can get this to work it will be SPOT ON!, how can I incorporate that into my form tag:
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="mailto:email@work.co.uk?subject="UNIQUE" name="FrontPage_Form1" onSubmit="return FrontPage_Form1_Validator(this)" language="JavaScript">
Please excuse me using Frontpage for making the form......
Aug 13 '07 #7
epots9
1,351 Expert 1GB
If I can get this to work it will be SPOT ON!, how can I incorporate that into my form tag:
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="mailto:email@work.co.uk?subject="UNIQUE" name="FrontPage_Form1" onSubmit="return FrontPage_Form1_Validator(this)" language="JavaScript">
Please excuse me using Frontpage for making the form......
like this:
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="mailto:email@work.co.uk?subject="UNIQUE" name="FrontPage_Form1" onSubmit="this.action += new Date().getTime(); return FrontPage_Form1_Validator(this)">
  2.  
Aug 13 '07 #8
pbmods
5,821 Expert 4TB
like this:
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="mailto:email@work.co.uk?subject="UNIQUE" name="FrontPage_Form1" onSubmit="this.action += new Date().getTime(); return FrontPage_Form1_Validator(this)">
  2.  
To nitpick: This will have unexpected results if the form fails to validate.

Instead, I would add the code to FrontPage_Form1_Validator(), right before the 'return true' at the end of it. Note that instead of 'this', you'll need to use the name of the first declared parameter for FrontPage_Form1_Validator().

For example:
Expand|Select|Wrap|Line Numbers
  1. function FrontPage_Form1_Validator( form )
  2. {
  3.     .
  4.     .
  5.     .
  6.     // Matches 'form' above.
  7.     form.action += new Date().getTime();
  8.     return true;
  9. }
  10.  
Aug 13 '07 #9
acoder
16,027 Expert Mod 8TB
Heya, plumba.

Here's one way to do it:
Expand|Select|Wrap|Line Numbers
  1. <form ... action="mailto:...?subject=" onsubmit="this.action += new Date().getTime(); return true;">
  2.  
Forgot about using date and time, though it's not 100% foolproof. OK, it's 99.999%, but there is still the extremely unlikely scenario where two users submit at the same time.
Aug 13 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Norman Bird | last post by:
I have a form i will use to register new people and when I click the submit button, the form just shows itself. It is supposed to show a message showing field errors if you leave fields blank etc....
7
by: Tony Clarke | last post by:
Hi, I'm trying to write a system thats used for about 50 clients that uses html forms and php to log details. The problem is that when a client loads the form page it's given a value which is...
4
by: Andrew Williams | last post by:
Does anyone know of a way to quickly validate an HTML web form? I need to make sure that certain fields on my form actually contain data and are not submitted blank. I have tried using...
3
by: John Dunlop | last post by:
(Note crosspost and follow-ups to ciwah.) Nicolas Keller wrote in thread "Differences in form handling btw Mozilla and IE?": > The problem: I'm using a form that submit's (POST) its data via...
2
by: Tim Mills | last post by:
The following code asks the user to sumbit a name, email address, and some text for a quotation via a FORM. I have written a javascript function to evaluate the fields in the form and pop-up a...
4
by: kschneider | last post by:
Assume there's a form with it's action attribute all set to post to a URL, but without a submit control. Form submission is done via a link and I want to prevent the classic "double submit"....
9
by: jasonrholland | last post by:
i have to build a table within access that receives it's information from an ASP web page and generates the primary key, with numbers and letters, from the data submitted. a numer would be like...
7
by: Anette | last post by:
Hi, I'm very new at PHP. I've tried for a long time now to get a page that has a form in a certain way: 1. When form is submitted the data in a table should be writted on the same page. 2....
3
by: ibeehbk | last post by:
Hi. I have a form made in xhtml. I test via vbscript to make sure none of the fields are empty and properly formatted (ie email). All the regular fields work. However, I have two drop down menus...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.