adriscoll Posted May 23, 2011 Share Posted May 23, 2011 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>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/ Share on other sites More sharing options...
crmamx Posted May 24, 2011 Share Posted May 24, 2011 Get a decent editor like NetBeans or Komodo. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219334 Share on other sites More sharing options...
adriscoll Posted May 24, 2011 Author Share Posted May 24, 2011 crmamx, i will be happy to look into those, but it doesn't exactly help me understand if my code is wrong. As i mentioned, this works for IE, but not the other browsers. thank you. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219337 Share on other sites More sharing options...
Drummin Posted May 24, 2011 Share Posted May 24, 2011 Maybe the double </script></script> is missing them up. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219377 Share on other sites More sharing options...
adriscoll Posted May 24, 2011 Author Share Posted May 24, 2011 Drummin, Thanks for catching that. That was quite a bonehead scrap to leave in there. Unfortunately, though, it didn't change the other browsers not reading it. I guess it's time to look into those other options. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219382 Share on other sites More sharing options...
Pikachu2000 Posted May 24, 2011 Share Posted May 24, 2011 My guess, based solely on the error message, is that you need to add the id="nletter" attribute to your <textarea> tag. And this is more of a JS/html problem, so I'm moving the thread tto JS help . . . Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219384 Share on other sites More sharing options...
adriscoll Posted May 24, 2011 Author Share Posted May 24, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219387 Share on other sites More sharing options...
Pikachu2000 Posted May 24, 2011 Share Posted May 24, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219389 Share on other sites More sharing options...
adriscoll Posted May 24, 2011 Author Share Posted May 24, 2011 I would think it would be considered a PHP issue if it works fine in plain HTML, but, because of an 'echo' or 'print' statement the outcome of functionality has changed. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219390 Share on other sites More sharing options...
Pikachu2000 Posted May 24, 2011 Share Posted May 24, 2011 The echo only outputs what it is coded to output. If it was coded to output the wrong markup, the problem is the markup not the php code that's outputting it. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219394 Share on other sites More sharing options...
crmamx Posted May 24, 2011 Share Posted May 24, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219623 Share on other sites More sharing options...
Adam Posted May 24, 2011 Share Posted May 24, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219628 Share on other sites More sharing options...
PFMaBiSmAd Posted May 24, 2011 Share Posted May 24, 2011 Did you ever do what Pikachu2000 suggested, because without an id so that the script can find the correct form element, it won't work - ... you need to add the id="nletter" attribute to your <textarea> tag. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1219633 Share on other sites More sharing options...
adriscoll Posted June 10, 2011 Author Share Posted June 10, 2011 For whatever reason, most browsers will not recognize the id although it is coded. I ended up removing any browser requirments from the backend, so now it works on all browsers. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1228131 Share on other sites More sharing options...
Adam Posted June 11, 2011 Share Posted June 11, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1228301 Share on other sites More sharing options...
PFMaBiSmAd Posted June 11, 2011 Share Posted June 11, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/237273-wysiwyg-editor-wont-recognize-textarea/#findComment-1228362 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.