How to integrate these two simple scripts together?

Discussion in 'HTML & Website Design' started by Trade2Win, May 7, 2008.

  1. #1
    Hello everyone, I'm trying to create a 'contact' form which basically sends an email to my address of whatever someone wrote in the form. But I'm also trying to integrate a rich text editor. So I found these two scripts:


    Here's the code for the contact form:

    <form action="feedback.php" method="post">
    									    <table width="416" border="0" cellpadding="8" cellspacing="8" summary="feedback form">
    <tr><td>Name:</td><td><input type="text" name="name" size="25" /></td></tr>
    <tr><td>Email address:</td><td><input type="text" name="email" size="25" /></td></tr>
    <tr>
    <td colspan="2">
      <h2 class="style3"><strong>Comments<br />
      </strong><br />
            <textarea rows="50" cols="45" name="comments" style="width:400px;"></textarea>
      </h2>
      </td>
    </tr>
    <tr>
    <td align="center" colspan="2">
    <input type="submit" value="Submit" /></td>
    </tr>
    </table>
    </form>
    Code (markup):
    Note I also have a 'feedback.php' which apparently handles everything.

    The code that enables the rich text area:

    <form name="RTEDemo" action="demo.htm" method="post" onSubmit="return submitForm();">
    <script language="JavaScript" type="text/javascript">
    <!--
    function submitForm() {
    	//make sure hidden and iframe values are in sync before submitting form
    	//to sync only 1 rte, use updateRTE(rte)
    	//to sync all rtes, use updateRTEs
    	updateRTE('rte1');
    	//updateRTEs();
    	alert("rte1 = " + document.RTEDemo.rte1.value);
    	
    	//change the following line to true to submit form
    	return false;
    }
    
    //Usage: initRTE(imagesPath, includesPath, cssFile)
    initRTE("images/", "", "");
    //-->
    </script>
    <noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
    
    <script language="JavaScript" type="text/javascript">
    <!--
    //Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
    writeRichText('rte1', 'here's the "<em>preloaded</em> <b>content</b>"', 400, 200, true, false);
    //-->
    </script>
    <p><input type="submit" name="submit" value="Submit"></p>
    </form>
    Code (markup):
    My question is, how can I integrate these two scripts so the second rich text script replaces the original textarea script.

    If that is not possible, how can I set it up so that the rich text script when clicking 'submit' actually sends to a certain email address.

    Any help would be greatly appreciated
     
    Trade2Win, May 7, 2008 IP
  2. Trade2Win

    Trade2Win Peon

    Messages:
    384
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Could anyone help?
     
    Trade2Win, May 8, 2008 IP