Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Copy form info from Javascript to Perl/CGI

    I have about 50 forms (HTML/Javascript) that send E-Mail using the typical Javascript code: (urlText is the MAILTO info)
    window.location.href = urlText;

    This was developed on a system where Perl/CGI was not made available to others than a systems group.

    Problem now is that many E-Mails are too long for Outlook/IE? to mail. Seems there is a limit of about 2000 characters. I expect that the Perl/CGI side has a much larger limit??

    I have a shared function that compiles the urlText and would like to simply copy urlText from that Javascript function to Perl/CGI routine which will then Mail with Perl.

    How might one do that directly from Javascript? I don't wish to return to the HTML form to execute the mailing.

    Appriciate your help.
    RON C

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    From the little information you have provided I can only assume that the form actions are using the mailto protocol and your problems arise when trying to forward email to multiple address while using one long comma delimted string which you are correct will break at around 2056 characters (Internet Explorer) when using not only the mailto protocol but the get method as well since this will create one long URI...

    Your solution would be to change the form actions to point towards your cgi form handler script and use serverside to send the mail rather than the clients email application...


    .....Willy

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Willy,

    Thanks for responding.

    What I'd like to do is preserve the JS form input, validating, etc. but use CGI/Perl to send the e-mail. At last count there are 67 forms the need changing. There is one common thread, I did something right, that gets as entries to a common/separate JS function -- the to, from, cc, bcc, info plus the body. This routine then builds the mail data as needed. I can easily change that routine but changing all forms to cgi is not feasable with my avail time.

    Can I do something like this:

    Build urlText within this one JS function as if for CGI Mail not JS MAILTO. Add this type code to that same JS function.

    var eMail = eval('http://www.xxxyyy.com/cgi-bin/script.pl?firstname=' + urlText);
    document.location.href = eMail;

    With the script.pl accepting the completed mail file and sending it to MAIL.
    Or could that code be changed to pipe (|) the urlText directly to MAIL.

    I never make it easy.
    Thaks,
    RON C


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •