DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Submit data for update and email?

  1. #1
    John K. Guest

    Submit data for update and email?


    I would like to have a "Submit" button on an ASP page that when clicked BOTH
    updates the data on the page and prompt an emil with the body of the email
    containing data changes being submitted (e.g. mailto.

    Right now, I could make my "Submit" button do one or the other but not both.
    Is this possible? TIA.

  2. #2
    Craig Guest

    Re: Submit data for update and email?

    You could use an onsubmit() event in your form tag to call a function that
    does both functions.
    "John K." <johnchulkang@hotmail.com> wrote in message
    news:39de1da4$1@news.devx.com...
    >
    > I would like to have a "Submit" button on an ASP page that when clicked

    BOTH
    > updates the data on the page and prompt an emil with the body of the email
    > containing data changes being submitted (e.g. mailto.
    >
    > Right now, I could make my "Submit" button do one or the other but not

    both.
    > Is this possible? TIA.




  3. #3
    John K. Guest

    Re: Submit data for update and email?


    Thanks Craig but how? Can you be little more specific?

    Let's say it I have
    onsubmit="return(myOnSubmitEventHandler());"

    Function myOnSubmitEventHandler
    ...process my data updates
    strTo = "myemail@mycompany.com"
    strSubject = "Please send this to me"
    strBody = "You have clicked on these items"

    Then what? How can I automatically popup an email from above? TIA.


    "Craig" <cjewiss.nospam@hotmail.com> wrote:
    >You could use an onsubmit() event in your form tag to call a function that
    >does both functions.
    >"John K." <johnchulkang@hotmail.com> wrote in message
    >news:39de1da4$1@news.devx.com...
    >>
    >> I would like to have a "Submit" button on an ASP page that when clicked

    >BOTH
    >> updates the data on the page and prompt an emil with the body of the email
    >> containing data changes being submitted (e.g. mailto.
    >>
    >> Right now, I could make my "Submit" button do one or the other but not

    >both.
    >> Is this possible? TIA.

    >
    >



  4. #4
    Craig Guest

    Re: Submit data for update and email?

    Here's a real basic example, but hopefully it will give you a starting point
    (I'm assuming you're using a mailto link and not sending from ASP using CDO)
    ;

    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <TITLE></TITLE>
    </HEAD>
    <SCRIPT LANGUAGE=javascript>
    <!--

    function doit()
    {
    window.open("mailto:" + document.test.emailto.value);
    return true;
    }
    //-->
    </SCRIPT>

    <BODY>

    <form name="test" method="post" action="savedata.asp" onsubmit="return
    doit()">

    <input type=input name=emailto>

    <INPUT type="submit" value="Send" id=submit1 name=submit1>
    </form>
    </BODY>
    </HTML>

    Hope that helps.

    "John K." <johnchulkang@hotmail.com> wrote in message
    news:39de4661$1@news.devx.com...
    >
    > Thanks Craig but how? Can you be little more specific?
    >
    > Let's say it I have
    > onsubmit="return(myOnSubmitEventHandler());"
    >
    > Function myOnSubmitEventHandler
    > ..process my data updates
    > strTo = "myemail@mycompany.com"
    > strSubject = "Please send this to me"
    > strBody = "You have clicked on these items"
    >
    > Then what? How can I automatically popup an email from above? TIA.
    >
    >
    > "Craig" <cjewiss.nospam@hotmail.com> wrote:
    > >You could use an onsubmit() event in your form tag to call a function

    that
    > >does both functions.
    > >"John K." <johnchulkang@hotmail.com> wrote in message
    > >news:39de1da4$1@news.devx.com...
    > >>
    > >> I would like to have a "Submit" button on an ASP page that when clicked

    > >BOTH
    > >> updates the data on the page and prompt an emil with the body of the

    email
    > >> containing data changes being submitted (e.g. mailto.
    > >>
    > >> Right now, I could make my "Submit" button do one or the other but not

    > >both.
    > >> Is this possible? TIA.

    > >
    > >

    >




  5. #5
    John K. Guest

    Re: Submit data for update and email?


    Thanks again Craig but I just need little more help.

    Can I call the javascript function doit from vbscript? I tried but I keep
    getting type mismatch error. The code is:

    <%
    Sub MyVBScriptFunction
    ...some codes

    Call doit()
    End Sub
    %>

    "Craig" <cjewiss.nospam@hotmail.com> wrote:
    >Here's a real basic example, but hopefully it will give you a starting point
    >(I'm assuming you're using a mailto link and not sending from ASP using

    CDO)
    >;
    >
    ><HTML>
    ><HEAD>
    ><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    ><TITLE></TITLE>
    ></HEAD>
    ><SCRIPT LANGUAGE=javascript>
    ><!--
    >
    >function doit()
    >{
    > window.open("mailto:" + document.test.emailto.value);
    > return true;
    >}
    >//-->
    ></SCRIPT>
    >
    ><BODY>
    >
    ><form name="test" method="post" action="savedata.asp" onsubmit="return
    >doit()">
    >
    ><input type=input name=emailto>
    >
    ><INPUT type="submit" value="Send" id=submit1 name=submit1>
    ></form>
    ></BODY>
    ></HTML>
    >
    >Hope that helps.
    >
    >"John K." <johnchulkang@hotmail.com> wrote in message
    >news:39de4661$1@news.devx.com...
    >>
    >> Thanks Craig but how? Can you be little more specific?
    >>
    >> Let's say it I have
    >> onsubmit="return(myOnSubmitEventHandler());"
    >>
    >> Function myOnSubmitEventHandler
    >> ..process my data updates
    >> strTo = "myemail@mycompany.com"
    >> strSubject = "Please send this to me"
    >> strBody = "You have clicked on these items"
    >>
    >> Then what? How can I automatically popup an email from above? TIA.
    >>
    >>
    >> "Craig" <cjewiss.nospam@hotmail.com> wrote:
    >> >You could use an onsubmit() event in your form tag to call a function

    >that
    >> >does both functions.
    >> >"John K." <johnchulkang@hotmail.com> wrote in message
    >> >news:39de1da4$1@news.devx.com...
    >> >>
    >> >> I would like to have a "Submit" button on an ASP page that when clicked
    >> >BOTH
    >> >> updates the data on the page and prompt an emil with the body of the

    >email
    >> >> containing data changes being submitted (e.g. mailto.
    >> >>
    >> >> Right now, I could make my "Submit" button do one or the other but

    not
    >> >both.
    >> >> Is this possible? TIA.
    >> >
    >> >

    >>

    >
    >



  6. #6
    Craig Guest

    Re: Submit data for update and email?

    John

    To give you a better answer, I need to know more about the code you're
    using. From your example below, it looks as though you are using
    server-side scripting, which makes me think you are processing the form data
    from a second page with ASP code. This changes the solution slightly. If
    you like, you can email your pages to me (remove the .nospam from my
    address), and I'll have a quick look (or post the code bits here, if they're
    not too big).
    "John K." <johnchulkang@hotmail.com> wrote in message
    news:39de6466$1@news.devx.com...
    >
    > Thanks again Craig but I just need little more help.
    >
    > Can I call the javascript function doit from vbscript? I tried but I keep
    > getting type mismatch error. The code is:
    >
    > <%
    > Sub MyVBScriptFunction
    > ..some codes
    >
    > Call doit()
    > End Sub
    > %>
    >
    > "Craig" <cjewiss.nospam@hotmail.com> wrote:
    > >Here's a real basic example, but hopefully it will give you a starting

    point
    > >(I'm assuming you're using a mailto link and not sending from ASP using

    > CDO)
    > >;
    > >
    > ><HTML>
    > ><HEAD>
    > ><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    > ><TITLE></TITLE>
    > ></HEAD>
    > ><SCRIPT LANGUAGE=javascript>
    > ><!--
    > >
    > >function doit()
    > >{
    > > window.open("mailto:" + document.test.emailto.value);
    > > return true;
    > >}
    > >//-->
    > ></SCRIPT>
    > >
    > ><BODY>
    > >
    > ><form name="test" method="post" action="savedata.asp" onsubmit="return
    > >doit()">
    > >
    > ><input type=input name=emailto>
    > >
    > ><INPUT type="submit" value="Send" id=submit1 name=submit1>
    > ></form>
    > ></BODY>
    > ></HTML>
    > >
    > >Hope that helps.
    > >
    > >"John K." <johnchulkang@hotmail.com> wrote in message
    > >news:39de4661$1@news.devx.com...
    > >>
    > >> Thanks Craig but how? Can you be little more specific?
    > >>
    > >> Let's say it I have
    > >> onsubmit="return(myOnSubmitEventHandler());"
    > >>
    > >> Function myOnSubmitEventHandler
    > >> ..process my data updates
    > >> strTo = "myemail@mycompany.com"
    > >> strSubject = "Please send this to me"
    > >> strBody = "You have clicked on these items"
    > >>
    > >> Then what? How can I automatically popup an email from above? TIA.
    > >>
    > >>
    > >> "Craig" <cjewiss.nospam@hotmail.com> wrote:
    > >> >You could use an onsubmit() event in your form tag to call a function

    > >that
    > >> >does both functions.
    > >> >"John K." <johnchulkang@hotmail.com> wrote in message
    > >> >news:39de1da4$1@news.devx.com...
    > >> >>
    > >> >> I would like to have a "Submit" button on an ASP page that when

    clicked
    > >> >BOTH
    > >> >> updates the data on the page and prompt an emil with the body of the

    > >email
    > >> >> containing data changes being submitted (e.g. mailto.
    > >> >>
    > >> >> Right now, I could make my "Submit" button do one or the other but

    > not
    > >> >both.
    > >> >> Is this possible? TIA.
    > >> >
    > >> >
    > >>

    > >
    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center