Unexpected result

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Wright

    Unexpected result

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

    "mailto:wright@ 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>


  • Lee

    #2
    Re: Unexpected result

    Steve Wright said:[color=blue]
    >
    >Can someone please tell me why the following code generates a new page with
    >
    >"mailto:wright @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();' >[/color]

    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.

    Comment

    • Steve Wright

      #3
      Re: Unexpected result Mailto:

      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" <REM0VElbspamtr ap@cox.net> wrote in message
      news:c81j6402j2 i@drn.newsguy.c om...[color=blue]
      > Steve Wright said:[color=green]
      > >
      > >Can someone please tell me why the following code generates a new page[/color][/color]
      with[color=blue][color=green]
      > >
      > >"mailto:wright @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();' >[/color]
      >
      > 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.
      >[/color]


      Comment

      • Lee

        #4
        Re: Unexpected result Mailto:

        Steve Wright said:[color=blue]
        >
        >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.[/color]

        You might want this:

        <form name="resurfaci ngrecord"
        action="mailto: wright@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.

        Comment

        • Steve Wright

          #5
          Re: Unexpected result

          Lee,
          When I use

          <form name = "Resurfacin g record" action =
          mailto:wright@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:wright@ 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" <REM0VElbspamtr ap@cox.net> wrote in message
          news:c81j6402j2 i@drn.newsguy.c om...[color=blue]
          > Steve Wright said:[color=green]
          > >
          > >Can someone please tell me why the following code generates a new page[/color][/color]
          with[color=blue][color=green]
          > >
          > >"mailto:wright @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();' >[/color]
          >
          > 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.
          >[/color]


          Comment

          • Lee

            #6
            Re: Unexpected result

            Steve Wright said:[color=blue]
            >
            >Lee,
            >When I use
            >
            ><form name = "Resurfacin g record" action =
            >mailto:wright@ 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:wright @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.[/color]

            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.

            Comment

            • Steve Wright

              #7
              Re: Unexpected result

              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" <REM0VElbspamtr ap@cox.net> wrote in message
              news:c897p106sk @drn.newsguy.co m...[color=blue]
              > Steve Wright said:[color=green]
              > >
              > >Lee,
              > >When I use
              > >
              > ><form name = "Resurfacin g record" action =
              > >mailto:wright@ 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:wright @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.[/color]
              >
              > 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.
              >[/color]


              Comment

              • Steve Wright

                #8
                Re: Unexpected result

                This is what I eventually used which does exactly what I want.



                function buildsubject()

                {

                var f = document.forms['resurfacingrec ord'];

                var sub = "mailto:wright@ 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" <wright@wcc.gov t.nz> wrote in message
                news:1084501423 .178254@muldoon ...[color=blue]
                > Can someone please tell me why the following code generates a new page[/color]
                with[color=blue]
                >
                > "mailto:wright@ 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>
                >
                >[/color]


                Comment

                Working...