473,387 Members | 1,742 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,387 software developers and data experts.

Unexpected result

Can someone please tell me why the following code generates a new page with

"mailto:wr****@wcc.govt.nz"?Subject= "RAMM Record Carriageway Resurfacing
Record" Method="POST" enctype="text/plain"

as a single line rather that generation an email?

<HTML>
<TITLE> test</TITLE>
<HEAD>
<script language = "javascript">

function mailsubject(msubject){

var mailto = " \"mailto:wright\@wcc.govt.nz\"?Subject= ";
var subbase = "\"RAMM Record Carriageway Resurfacing Record" + "\"";
var method = " Method=" + "\"POST\"" + " enctype=" +"\"text" + "\/"
+"plain\"";
msub = mailto + subbase + method;
window.status = (msub);
return (msub);
alert(msub);
}
</script>

</HEAD>
<body>
<form name = "resurfacingrecord" action= 'javascript:mailsubject();' >

<select name="contract">
<option value="">Select Contract</option>
<option value="RS-330">RS-330 Northern</option>
<option value="RS-331">RS-331 Southern</option>
</select>
<input type=submit value="Send Record">

</form>
</HTML>
Jul 23 '05 #1
7 1285
Lee
Steve Wright said:

Can someone please tell me why the following code generates a new page with

"mailto:wr****@wcc.govt.nz"?Subject= "RAMM Record Carriageway Resurfacing
Record" Method="POST" enctype="text/plain"

as a single line rather that generation an email?

<HTML>
<TITLE> test</TITLE>
<HEAD>
<script language = "javascript">

function mailsubject(msubject){

var mailto = " \"mailto:wright\@wcc.govt.nz\"?Subject= ";
var subbase = "\"RAMM Record Carriageway Resurfacing Record" + "\"";
var method = " Method=" + "\"POST\"" + " enctype=" +"\"text" + "\/"
+"plain\"";
msub = mailto + subbase + method;
window.status = (msub);
return (msub);
alert(msub);
}
</script>

</HEAD>
<body>
<form name = "resurfacingrecord" action= 'javascript:mailsubject();' >


The action attribute identifies the new page to load.
You've said that the new page to load is what is returned
by the mailsubject() function. The return value of the
mailsubject() function is exactly what you're seeing.

Jul 23 '05 #2
OK,

What I had intended was that an Email be sent with the subject of "RAMM
Record Carriageway Resurfacing Record". I know that I can Hard code this
but I wanted to extend the funcion to include a number of form fields in the
subject.

Steve
"Lee" <RE**************@cox.net> wrote in message
news:c8*********@drn.newsguy.com...
Steve Wright said:

Can someone please tell me why the following code generates a new page with
"mailto:wr****@wcc.govt.nz"?Subject= "RAMM Record Carriageway Resurfacing
Record" Method="POST" enctype="text/plain"

as a single line rather that generation an email?

<HTML>
<TITLE> test</TITLE>
<HEAD>
<script language = "javascript">

function mailsubject(msubject){

var mailto = " \"mailto:wright\@wcc.govt.nz\"?Subject= ";
var subbase = "\"RAMM Record Carriageway Resurfacing Record" + "\"";
var method = " Method=" + "\"POST\"" + " enctype=" +"\"text" + "\/"
+"plain\"";
msub = mailto + subbase + method;
window.status = (msub);
return (msub);
alert(msub);
}
</script>

</HEAD>
<body>
<form name = "resurfacingrecord" action= 'javascript:mailsubject();' >


The action attribute identifies the new page to load.
You've said that the new page to load is what is returned
by the mailsubject() function. The return value of the
mailsubject() function is exactly what you're seeing.

Jul 23 '05 #3
Lee
Steve Wright said:

OK,

What I had intended was that an Email be sent with the subject of "RAMM
Record Carriageway Resurfacing Record". I know that I can Hard code this
but I wanted to extend the funcion to include a number of form fields in the
subject.


You might want this:

<form name="resurfacingrecord"
action="mailto:wr****@wcc.govt.nz"
onsubmit="this.action=mailsubject()">

But you should be aware that mailto: is completely unreliable.
You have know assurance that your customer has a mail client
configured to work with their browser.

Jul 23 '05 #4
Lee,
When I use

<form name = "Resurfacing record" action =
mailto:wr****@wcc.govt.nz?subject=RAMM Resurfacing Record method = post
enctype="text/plain">

I get an email back with all the form fields as I would expect.

all I am trying to do is get

"mailto:wr****@wcc.govt.nz?subject=RAMM Resurfacing Record method = post
enctype="text/plain""

pased to the action so that I can add some of the form fields to the
subject.

Steve
"Lee" <RE**************@cox.net> wrote in message
news:c8*********@drn.newsguy.com...
Steve Wright said:

Can someone please tell me why the following code generates a new page with
"mailto:wr****@wcc.govt.nz"?Subject= "RAMM Record Carriageway Resurfacing
Record" Method="POST" enctype="text/plain"

as a single line rather that generation an email?

<HTML>
<TITLE> test</TITLE>
<HEAD>
<script language = "javascript">

function mailsubject(msubject){

var mailto = " \"mailto:wright\@wcc.govt.nz\"?Subject= ";
var subbase = "\"RAMM Record Carriageway Resurfacing Record" + "\"";
var method = " Method=" + "\"POST\"" + " enctype=" +"\"text" + "\/"
+"plain\"";
msub = mailto + subbase + method;
window.status = (msub);
return (msub);
alert(msub);
}
</script>

</HEAD>
<body>
<form name = "resurfacingrecord" action= 'javascript:mailsubject();' >


The action attribute identifies the new page to load.
You've said that the new page to load is what is returned
by the mailsubject() function. The return value of the
mailsubject() function is exactly what you're seeing.

Jul 23 '05 #5
Lee
Steve Wright said:

Lee,
When I use

<form name = "Resurfacing record" action =
mailto:wr****@wcc.govt.nz?subject=RAMM Resurfacing Record method = post
enctype="text/plain">

I get an email back with all the form fields as I would expect.

all I am trying to do is get

"mailto:wr****@wcc.govt.nz?subject=RAMM Resurfacing Record method = post
enctype="text/plain""

pased to the action so that I can add some of the form fields to the
subject.


The example code I posted should do that for you.
However, I warn you again that this will not work for all visitors
to your web site. "mailto:" will only work if you happen to have
a mail client configured in your browser. The fact that it works
for you means that you have your browser configured to work that
way.

Jul 23 '05 #6
Lee

All that seems to do is open a blank Email!

Steve
PS Ive been using the mailto; sucsessfully for collection of the info until
now with a hard coded subject but I need to add some form fields to make the
resulting emails identifiable.
"Lee" <RE**************@cox.net> wrote in message
news:c8********@drn.newsguy.com...
Steve Wright said:

Lee,
When I use

<form name = "Resurfacing record" action =
mailto:wr****@wcc.govt.nz?subject=RAMM Resurfacing Record method = post
enctype="text/plain">

I get an email back with all the form fields as I would expect.

all I am trying to do is get

"mailto:wr****@wcc.govt.nz?subject=RAMM Resurfacing Record method = post
enctype="text/plain""

pased to the action so that I can add some of the form fields to the
subject.


The example code I posted should do that for you.
However, I warn you again that this will not work for all visitors
to your web site. "mailto:" will only work if you happen to have
a mail client configured in your browser. The fact that it works
for you means that you have your browser configured to work that
way.

Jul 23 '05 #7
This is what I eventually used which does exactly what I want.

function buildsubject()

{

var f = document.forms['resurfacingrecord'];

var sub = "mailto:wr****@wcc.govt.nz?subject=RAMM Carriageway
Resurfacing Record " + (f.roadname.value) + " " + (f.startroad.value) + "-"
+ (f.endroad.value);

f.action = sub;

}

along with this as the form tag

<form name = "resurfacingrecord" action="about:blank" method="post"
enctype="text/plain" onSubmit="buildsubject()">

and this for the form button

<input type=submit value="Send Record">

"Steve Wright" <wr****@wcc.govt.nz> wrote in message
news:1084501423.178254@muldoon...
Can someone please tell me why the following code generates a new page with
"mailto:wr****@wcc.govt.nz"?Subject= "RAMM Record Carriageway Resurfacing
Record" Method="POST" enctype="text/plain"

as a single line rather that generation an email?

<HTML>
<TITLE> test</TITLE>
<HEAD>
<script language = "javascript">

function mailsubject(msubject){

var mailto = " \"mailto:wright\@wcc.govt.nz\"?Subject= ";
var subbase = "\"RAMM Record Carriageway Resurfacing Record" + "\"";
var method = " Method=" + "\"POST\"" + " enctype=" +"\"text" + "\/"
+"plain\"";
msub = mailto + subbase + method;
window.status = (msub);
return (msub);
alert(msub);
}
</script>

</HEAD>
<body>
<form name = "resurfacingrecord" action= 'javascript:mailsubject();' >

<select name="contract">
<option value="">Select Contract</option>
<option value="RS-330">RS-330 Northern</option>
<option value="RS-331">RS-331 Southern</option>
</select>
<input type=submit value="Send Record">

</form>
</HTML>

Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sky2070 | last post by:
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ')' in c:\inetpub\wwwroot\session.php on line 19 can anyone tell me what is wrong with this code??? <? // Define the Session...
2
by: Salim | last post by:
Hi people, keep getting this errorParse error: parse error, unexpected T_STRING in order_fns.php line 91. the code is below for the file and I've indicated line 91 <?php function...
6
by: Ehartwig | last post by:
I recently created a script for user verification, solved my emailing issues, and then re-created the script in order to work well with the new PHP 5 that I installed on my server. After...
62
by: ashu | last post by:
hi look at this code include <stdio.h> int main(void) { int i,j=2; i=j++ * ++j * j++; printf("%d %d",i,j); return 0;
5
by: devereaux | last post by:
I'm trying to run a script and it's throwing the following error: Parse error: syntax error, unexpected T_OBJECT_OPERATOR in openfile.php on line 41 Here is the openfile.php file and I have...
13
by: bintom | last post by:
I ran the following simple code in C++ and got unexpected results: float f = 139.4; cout << f; Output: 139.399994;
2
by: =?Utf-8?B?QXJtaW4gR2FsbGlrZXI=?= | last post by:
Hi I've got an unexpected error in a unit test. I want to test a activity from Windows Workflow Foundation (WF). First, I executed the test outside of the activity just in the test-init...
11
by: JRough | last post by:
I'm trying to use output buffering to cheat so i can print to excel which is called later than this header(). header("Content-type: application/xmsdownload"); header("Content-Disposition:...
14
riverdale1567
by: riverdale1567 | last post by:
Hi I am a newbie trying to get some of my first code working, yada yada yada. I have a drop down box which chooses a state then takes the post data to 'processform2.php' to use that to pull up...
14
by: Padfoot153 | last post by:
Hey, I'm getting the error: Parse error: syntax error, unexpected T_VARIABLE in /Users/Oscar/AwesomeSongz/userCake/profile.php on line 7 with this code <?php...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.