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

    submitting and printing a form

    OK, here is my current conundrum.

    I have a form which needs a signature but I still want to collect the data in a csv. So what I am after is a way of printing and submitting the form at the same time.

    EASY - i hear you cry.

    however I have a number of textareas in the form so I am using a strip out special characters script which i have to call aswell and it is this that is causing me angst...

    When i try and call both it tells me that my textarea is undefined or null.

    The code I am using is as follows:
    <SCRIPT LANGUAGE="JavaScript">

    function printPage() {
    if (window.print)
    alert("Sorry, your browser doesn't support this feature.");

    // -->

    <script language="javascript">
    <!-- Begin
    function whatIsThis() {
    document.myform.textone.value = escape(document.myform.textone.value);

    and then the submit button is doing the following

    <a href="javascript:document.myform.submit();" onClick="printPage();whatIsThis();">
    <img src="submit.gif" width="52" height="18" border="0">

    I am using a generic form into csv handler so can't write a specific form handler that does exactly what I want.

    any solutions?

    Do you need further info to help? If so what info do you need?

    All help greatly appreciated.


  • #2
    Senior Coder
    Join Date
    Aug 2002
    Thanked 0 Times in 0 Posts
    I *may* have a solution for you with a simple change

    Instead of using the anchor/image combo for your submit, just use a type=image input, which by default submits the form. And, you should use onSubmit becuase it can be delayed until the function whatIsThis() runs successfully.
    function whatIsThis(f) {
    	f.textone.value = escape(f.textone.value);
    	return true;
    <form onSubmit="return whatIsThis(this);">
    [....FORM STUFF....]
    <input type="image" src="submit.gif" />


    Posting Permissions

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