Jump to content

WYSIWYG Editor Won't Recognize Textarea


adriscoll

Recommended Posts

Hello.

 

I am using openWYSIWYG by openWebWare.  It works great on IE but will not function on any other browsers.  It gives the error message, "No text area found with the given identifier (ID: nletter)."

 

I think this is because of how I coded it, but could use an expert opinion.

 

Thank you in advance.

 

<script language="JavaScript" type="text/javascript" src="openwysiwyg_v1.4.7/scripts/wysiwyg.js"></script></script> 
<script language="javascript1.2">
// attach the editor to a specific text area
   WYSIWYG.attach('nletter'); </script> 


<?php

include('dbconfig.php');

// Make a MySQL Connection
mysql_connect("localhost", "$user", "$password") or die(mysql_error());
mysql_select_db("$database") or die(mysql_error());

$adminmail="crew@xxx.com";
// Pass the event id variable
$event_id=$_GET['id'];

if(isset($_POST['submit']))
{
  $subject=$_POST['subject'];
  $nletter=$_POST['nletter'];
  if(strlen($subject)<1)
  {
     print "You did not enter a subject.";
  }
  else if(strlen($nletter)<1)
  {
    print "You did not enter a message.";
  } 
  else
  {
  
  $nletter=$_POST['nletter'];
      $subject=$_POST['subject'];
      $nletter=stripslashes($nletter);
      $subject=stripslashes($subject);
      $lists=$_POST['lists'];
      $nletter=str_replace("rn","<br>",$nletter);
      //the block above formats the letter so it will send correctly.
      
  
  $getlist="SELECT * from volunteer WHERE event_id = '$event_id' "; //select e-mails in ABC order
      $getlist2=mysql_query($getlist) or die("Could not get list");
  
  while($getlist3=mysql_fetch_array($getlist2))
      {
         $headers = "From: $adminmail \r\n";   //unlock adminmail above and insert $adminmail for email address
         $headers.= "Content-Type: text/html; charset=ISO-8859-1 ";  //send HTML enabled mail
         $headers .= "MIME-Version: 1.0 ";     
         mail("$getlist3[email]","$subject","$nletter",$headers);
      }
      print "Your Message Has Been Sent.";
    }
}
else
{
   print "<form action='volunteer_send.php?id=".$event_id."' method='post'>";
   print "Subject:<br>";
   print "<input type='text' name='subject' size='20'><br><br>";
   print "Message:<br>";
   print "<textarea name='nletter' cols='50' rows='6'></textarea><br><br>";
   print "<input type='submit' name='submit' value='submit'></form>";


}
?>

Link to comment
Share on other sites

Pikachu2000,

 

thank you for observing this post, but I have to disagree.  This is not a HTML or JS issue.  It is a php code issue in which the browser was not recognizing the textarea identification because of the single quotes.

 

thank you.

 

adriscoll

Link to comment
Share on other sites

PHP has no effect on how the browser renders things. If the single quotes in the <textarea> tag were the problem, then it is an HTML issue, not a PHP issue. PHP outputs exactly what it's told to output, nothing more, nothing less.

Link to comment
Share on other sites

The reason I suggested getting a different editor is a while back I was doing the same thing...using a WYSIWYG editor. As soon as I started trying to use any JS or php the editor totally screwed it up. You at least need to eliminate that as a source of any problems.

Link to comment
Share on other sites

The reason I suggested getting a different editor is a while back I was doing the same thing...using a WYSIWYG editor. As soon as I started trying to use any JS or php the editor totally screwed it up. You at least need to eliminate that as a source of any problems.

 

openWYSIWYG is not an editor for code, it's for those rich-text textareas you see within web pages. There's a demo here.

Link to comment
Share on other sites

  • 3 weeks later...
For whatever reason, most browsers will not recognize the id although it is coded.

 

To be blunt, I don't think this will be a problem with the browser, but the way you're doing it. Can you show us the code? It's probably just something simple but completely not obvious.

 

I ended up removing any browser requirments from the backend, so now it works on all browsers.

 

What do you mean by this; runs in a terminal?

Link to comment
Share on other sites

I'm going to guess that the id mentioned in the latest post by the OP referred to the $_GET['id'] in/from the URL (not the id that was missing in the HTML that was preventing the wysiwyg code from working and that produce the original error message.)

 

Nothing you posted in the code in this thread shows where the $_GET['id'] value is originally coming from. You likely had an error in the originating code (edit links perhaps?) or you are redirecting to the page you showed us but not carrying the get parameters on the end of the URL or you have some URL rewriting that is being done incorrectly that doesn't carry the get parameter through on the end of the URL.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.