473,803 Members | 3,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unexpected result

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

"mailto:wr****@ wcc.govt.nz"?Su bject= "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(msu bject){

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 = "resurfacingrec ord" action= 'javascript:mai lsubject();' >

<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 1303
Lee
Steve Wright said:

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

"mailto:wr**** @wcc.govt.nz"?S ubject= "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(msu bject){

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.statu s = (msub);
return (msub);
alert(msub);
}
</script>

</HEAD>
<body>
<form name = "resurfacingrec ord" action= 'javascript:mai lsubject();' >


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.c om...
Steve Wright said:

Can someone please tell me why the following code generates a new page with
"mailto:wr**** @wcc.govt.nz"?S ubject= "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(msu bject){

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.statu s = (msub);
return (msub);
alert(msub);
}
</script>

</HEAD>
<body>
<form name = "resurfacingrec ord" action= 'javascript:mai lsubject();' >


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="resurfaci ngrecord"
action="mailto: wr****@wcc.govt .nz"
onsubmit="this. action=mailsubj ect()">

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 = "Resurfacin g record" action =
mailto:wr****@w cc.govt.nz?subj ect=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?sub ject=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.c om...
Steve Wright said:

Can someone please tell me why the following code generates a new page with
"mailto:wr**** @wcc.govt.nz"?S ubject= "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(msu bject){

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.statu s = (msub);
return (msub);
alert(msub);
}
</script>

</HEAD>
<body>
<form name = "resurfacingrec ord" action= 'javascript:mai lsubject();' >


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 = "Resurfacin g record" action =
mailto:wr****@ wcc.govt.nz?sub ject=RAMM Resurfacing Record method = post
enctype="tex t/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?su bject=RAMM Resurfacing Record method = post
enctype="tex t/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.co m...
Steve Wright said:

Lee,
When I use

<form name = "Resurfacin g record" action =
mailto:wr****@ wcc.govt.nz?sub ject=RAMM Resurfacing Record method = post
enctype="tex t/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?su bject=RAMM Resurfacing Record method = post
enctype="tex t/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['resurfacingrec ord'];

var sub = "mailto:wr****@ wcc.govt.nz?sub ject=RAMM Carriageway
Resurfacing Record " + (f.roadname.val ue) + " " + (f.startroad.va lue) + "-"
+ (f.endroad.valu e);

f.action = sub;

}

along with this as the form tag

<form name = "resurfacingrec ord" action="about:b lank" method="post"
enctype="text/plain" onSubmit="build subject()">

and this for the form button

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

"Steve Wright" <wr****@wcc.gov t.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"?Su bject= "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(msu bject){

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 = "resurfacingrec ord" action= 'javascript:mai lsubject();' >

<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
51397
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 class class Session { // Define the properties:
2
2887
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 process_card($card_details) { // connect to payment gateway or // use gpg to encrypt and mail or // store in DB if you really want to
6
19031
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 submitting user information into my creation script, I get the following error from the page that is suppose to insert the user data into the database, create a code, then send an email out for verification. Parse error: parse error, unexpected $end in...
62
3798
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
14011
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 bolded line 41. Any ideas/help would be greatly appreciated! <?php /* This file is responsible for the download of the files
13
3622
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
3431
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 method. In this case all works fine: public void TestInitialize() {
11
2938
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: attachment; header("Pragma: no-cache"); header("Expires; 0"); print "$header\n$data";
14
5512
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 all the rows which have the corresponding state. I am getting this 'Parse error: syntax error, unexpected T_STRING in /home/attorney/public_html/' on line 13 <? $username="XXXXXXXX"; $password="XXXXXX"; $database="XXXXXXXX";
14
3610
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 require_once("models/config.php"); function signinTimeStamp()
0
9700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9564
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.