Forum Moderators: open

Message Too Old, No Replies

Naming a document.write

Needing help with document.write in a form

         

ssimon

3:39 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



I am using a form that shows the date of today as a guide for the end user to reference to.

document.write(dateline[Style]);
</SCRIPT>

I would like to be able to pull the information (the date) and have it listed on my Form that I send to my email, so that I know what date the email was sent. Is there a way to call it?

Example:(in the form)
document.write(dateline[Style]);
(name="todaysdate")

and return:
#Form.todaysdate#

Thank you

Fotiman

3:45 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Not sure I understand what you're asking. But do you mean something like this:

<form action="youraction">
<script type="text/javascript">
document.write("<input type='hidden' name='todaysdate' value='" + dateline[Style] + "'>");
</script>
...
</form>

ssimon

4:10 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



Sorry - just getting really frustrated with this - let me see if I can explain a little more:

HTML-FORM
Order Date:
(script runs and shows today's date)
<SCRIPT language="JavaScript">
..............
..............
document.write(dateline[Style])
</SCRIPT>
Due Date:<input name="duedate" >

HTML Shows the following
Order Date: Tue November, 8, 2005
Due Date: <customer fills out input>

On Submit - this sends me a email with "Due Date: #Form.duedate#"

I am trying to find a way to also pull the Date over to my email so I will have records of the date the form was filled out.

Fotiman

5:45 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In that case, just do this:


HTML-FORM
Order Date:
(script runs and shows today's date)
<SCRIPT language="JavaScript">
..............
..............
document.write(dateline[Style]);
document.write("<input type='hidden' name='todaysdate' value='" + dateline[Style] + "'>");
</SCRIPT>
Due Date:<input name="duedate" >

That will put the value into a hidden field. If the page that processes the form simply iterates through all of the form input and sends it to you in email, then it will include this hidden value. However, if your form processing page references each item by name, then you'll need to modify that page to look for "todaysdate".

Hope that helps.