14 Replies Latest reply: Apr 14, 2012 10:53 PM by sudarshan.t RSS

    Firefox fails to display form content from mysql

    smiffy47 Community Member

      Firefox 11 is failing to display text from a mysql dbase.  Within the form there are various text boxes and text areas that function correctly, but one text area that remains inert. No content from the dbase and will not display flashing curser. It functions OK in IE8.  I can see no reason for this.  Can you?

      The code of the whole code is quoted below. I have enboldened the relevant miscreant line.

      :

        <td colspan="2" rowspan="10"><form name="form1" method="POST" action="<?php echo $editFormAction; ?>">

            <table width="100%"  border="0" cellspacing="0" cellpadding="2">

              <tr>

                <td width="20%" class="right_cell">**Name of Organisation or Service:</td>

                <td colspan="4"><input name="cel_org" type="text" id="cel_org" onBlur="MM_validateForm('textfield','','R','textarea','','R');return document.MM_returnValue" value="<?php echo $row_rstUpEntry['cel_org']; ?>" size="60" maxlength="60">

            Town

              <input name="ck_town" type="text" id="ck_town" value="<?php echo $row_rstSix['ck_town']; ?>" size="20" maxlength="20"></td>

              </tr>

              <tr>

                <td class="right_cell">Telephone Number: </td>

                <td colspan="4"><input name="cel_tel" type="text" id="cel_tel" value="<?php echo $row_rstUpEntry['cel_tel']; ?>" size="30"></td>

              </tr>

              <tr>

                <td class="right_cell">Fax Number : </td>

                <td colspan="4"><input name="cel_fax" type="text" id="cel_fax" value="<?php echo $row_rstUpEntry['cel_fax']; ?>"></td>

              </tr>

              <tr>

                <td class="right_cell">Helpline Number :</td>

                <td colspan="4"><input name="cel_hlp" type="text" id="cel_hlp" value="<?php echo $row_rstUpEntry['cel_hlp']; ?>"></td>

              </tr>

              <tr>

                <td class="right_cell">Email address: </td>

                <td colspan="4"><input name="cel_email" type="text" id="cel_email" value="<?php echo $row_rstUpEntry['cel_email']; ?>" size="40"></td>

              </tr>

              <tr>

                <td class="right_cell">Website address:<br>

            Please use format www.etc.....</td>

                <td colspan="4"><input name="cel_web" type="text" id="cel_web" value="<?php echo $row_rstUpEntry['cel_web']; ?>" size="75" maxlength="100"></td>

              </tr>

              <tr>

                <td class="right_cell"><p>Address of Organisation:<br>

              (on single line) </p></td>

                <td colspan="4"><input name="cel_add" type="text" id="cel_add" value="<?php echo $row_rstUpEntry['cel_add']; ?>" size="75" maxlength="100"></td>

              </tr>

              <tr>

                <td class="right_cell"><p>**Description of your service:<br>

                </p></td>

                <td colspan="4" class="top_cell"><textarea name="cel_blb" cols="75" rows="8" id="cel_blb"><?php echo $row_rstUpEntry['cel_blb']; ?></textarea></td>

              </tr>

              <tr>

                <td class="right_cell">Message for email if there are handouts: </td>

                <td colspan="4" class="top_cell"><input name="cel_hndts" type="text" id="cel_hndts" value="<?php echo $row_rstUpEntry['cel_hndts']; ?>" size="100" maxlength="200"></td>

              </tr>

              <tr>

                <td class="right_cell"><h3>Contact Details</h3></td>

                <td colspan="4" class="top_cell"> </td>

              </tr>

              <tr>

                <td class="right_cell">Manager:</td>

                <td colspan="4" class="top_cell"><input name="ck_manager" type="text" id="ck_manager" value="<?php echo $row_rstSix['ck_manager']; ?>" size="35"></td>

              </tr>

              <tr>

                <td class="right_cell">Contact's Full name:</td>

                <td colspan="4" class="top_cell"><input name="ck_contact" type="text" id="ck_contact" value="<?php echo $row_rstSix['ck_contact']; ?>" size="35"></td>

              </tr>

              <tr>

                <td class="right_cell">First name:</td>

                <td colspan="4" class="top_cell"><input name="ck_firstname" type="text" id="ck_firstname" value="<?php echo $row_rstSix['ck_firstname']; ?>" size="35"></td>

              </tr>

              <tr>

                <td class="right_cell">Last name: </td>

                <td colspan="4" class="top_cell">

                  <input name="ck_lastname" type="text" id="ck_lastname" value="<?php echo $row_rstSix['ck_lastname']; ?>" size="35">

                </td>

              </tr>

              <tr>

                <td class="right_cell">Contact's position:</td>

                <td colspan="4" class="top_cell"><input name="ck_position" type="text" id="ck_position" value="<?php echo $row_rstSix['ck_position']; ?>" size="35"></td>

              </tr>

              <tr>

                <td height="24" class="right_cell">Contact's tel:</td>

                <td colspan="4" class="top_cell"><input name="ck_tel" type="text" id="ck_tel" value="<?php echo $row_rstSix['ck_tel']; ?>" size="35"></td>

              </tr>

              <tr>

                <td class="right_cell">Contact's email: </td>

                <td colspan="4" class="top_cell"><input name="ck_email" type="text" id="ck_email" value="<?php echo $row_rstSix['ck_email']; ?>" size="45"></td>

              </tr>

              <tr>

                <td class="right_cell"> </td>

                <td colspan="4" class="top_cell"> </td>

              </tr>

              <tr>

                <td class="right_cell"> </td>

                <td colspan="4" class="top_cell"> </td>

              </tr>

              <tr>

                <td class="right_cell">My own notes: </td>

                <td colspan="4" class="top_cell"><textarea name="ck_notes" cols="75" rows="4" id="ck_notes"><?php echo $row_rstSix['ck_notes']; ?></textarea></td>

              </tr>

              <tr>

                <td class="right_cell">Confirm and Submit: </td>

                <td width="10%"><input type="submit" name="Submit" value="Submit">

                </td>

                <td width="22%"><a href="../index.htm">Return To Website</a></td>

                <td width="9%"><a href="chk_access.php?org=<?php echo $row_rstSix['ck_organisation']; ?>">Access</a></td>

                <td width="39%"><a href="chk_insert.php">List</a></td>

              </tr>

              <tr>

                <td class="right_cell">**These fields are required.</td>

                <td colspan="4"> </td>

              </tr>

              <tr>

                <td class="right_cell"> </td>

                <td colspan="4"> </td>

              </tr>

            </table>

            <input type="hidden" name="MM_update" value="form1">

          </form></td>

       

      Any help most gratefully received.

        • 1. Re: Firefox fails to display form content from mysql
          Burak Ueda Community Member

          Do you have any style definitions for the id "cel_blb" ?

          • 2. Re: Firefox fails to display form content from mysql
            sudarshan.t CommunityMVP

            Try loading your site on http://browserlab.adobe.com and compare multi-browsers there. Let us know what the results are.

            • 3. Re: Firefox fails to display form content from mysql
              smiffy47 Community Member

              Thanks Burak Ueda. I have no style definitions for the id "cel_blb". As you can see the cell in question has the style "top_cell" applied to it, as do the other form elements. On my .css page "top_cell" simply reads:

              .top_cell {

                  vertical-align: top;

              }

              • 4. Re: Firefox fails to display form content from mysql
                sudarshan.t CommunityMVP

                Can you upload your files and give us an active link so we could test it?

                • 5. Re: Firefox fails to display form content from mysql
                  smiffy47 Community Member

                  Sorry about the delay, Sudarsham.

                  There is a difficulty with both of your suggestions. I am reluctant to give public access, even on this forum, to this area of my website because someone could maliciously interfere with the contents of the database. It is therefore a protected by password. Because of this restricted access I find the Adobe BrowserLab is unable to link to the page. All a bit frustrating.

                  Thanks for trying to help.

                  I am bewildered as to why this one textarea is behaing differently to the other on the same page.

                  • 6. Re: Firefox fails to display form content from mysql
                    sudarshan.t CommunityMVP

                    A couple of options I see in this scenario:

                     

                    1. Try loading up the page on a previous version of Firefox

                    2. Try opening Firefox 11 with add-ons disabled (safe mode) - if I'm not wrong, the hotkey is to hold ALT or OPT when opening

                     

                    See if these work

                     

                    If possible, atleast post a DB Schema here with the collation types. FF 11 has some issues fetching certain table types in MySQL and I've personally experienced these.

                    • 7. Re: Firefox fails to display form content from mysql
                      smiffy47 Community Member

                      Bingo! Yes, the textarea performs well in ff4, but not in ff11 safe-mode.

                      I'm not sure what you mean by "DB Schema" but I guess it might be the tabel below.  Let me know if not.

                      You'll see cel_blb third from bottom.

                       

                      dbase.jpg

                       

                      Many thanks for your help.

                       

                      Message was edited by: smiffy47to improve the image quality.

                      • 8. Re: Firefox fails to display form content from mysql
                        sudarshan.t CommunityMVP

                        I guess there seems to be an issue with one or more of add-ons you've installed in Firefox. Did you also check in FF4 (without Safe Mode)?

                         

                        Try doing the following:

                         

                        First backup your Database, then try one of these 2 options:

                         

                        1. Change your DB collation type to utf8_general

                        Check in FF11.

                         

                        2. Change the type of cel_blb to text instead of mediumtext

                        Check in FF11.

                         

                        See of either of these options work.

                         

                        If not, let us know what character set you're using in your HTML header (post your HTML header if possible). Also, post a list of all your add-ons that you've installed on Firefox. In firefox, type about:addons in your addressbar to bring up the list of all add-ons.

                        • 9. Re: Firefox fails to display form content from mysql
                          smiffy47 Community Member

                          Thanks for following this up, Sudarshan.

                          Your 2 suggestions in the previous post yielded no improvement.

                          I post below the portion of the webpage that precedes the form quoted above.  I wonder if the use of TinyMCE is causing the problem.

                           

                          <?php require_once('../../Connections/tormented3.php'); ?>

                          <?php

                          function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

                          {

                            $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

                           

                            switch ($theType) {

                              case "text":

                                $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                                break;   

                              case "long":

                              case "int":

                                $theValue = ($theValue != "") ? intval($theValue) : "NULL";

                                break;

                              case "double":

                                $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";

                                break;

                              case "date":

                                $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";

                                break;

                              case "defined":

                                $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;

                                break;

                            }

                            return $theValue;

                          }

                           

                          $editFormAction = $_SERVER['PHP_SELF'];

                          if (isset($_SERVER['QUERY_STRING'])) {

                            $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);

                          }

                           

                          if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {

                            $updateSQL = sprintf("UPDATE cel_contents SET cel_tel=%s, cel_fax=%s, cel_hlp=%s, cel_email=%s, cel_web=%s, cel_add=%s, cel_blb=%s, cel_hndts=%s WHERE cel_org=%s",

                                                 GetSQLValueString($_POST['cel_tel'], "text"),

                                                 GetSQLValueString($_POST['cel_fax'], "text"),

                                                 GetSQLValueString($_POST['cel_hlp'], "text"),

                                                 GetSQLValueString($_POST['cel_email'], "text"),

                                                 GetSQLValueString($_POST['cel_web'], "text"),

                                                 GetSQLValueString($_POST['cel_add'], "text"),

                                                 GetSQLValueString($_POST['cel_blb'], "text"),

                                                 GetSQLValueString($_POST['cel_hndts'], "text"),

                                                 GetSQLValueString($_POST['cel_org'], "text"));

                           

                            mysql_select_db($database_tormented3, $tormented3);

                            $Result1 = mysql_query($updateSQL, $tormented3) or die(mysql_error());

                          }

                           

                          if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {

                            $updateSQL = sprintf("UPDATE chk_sixmonth SET ck_town=%s, ck_manager=%s, ck_contact=%s, ck_firstname=%s, ck_lastname=%s, ck_position=%s, ck_tel=%s, ck_email=%s, ck_notes=%s WHERE ck_organisation=%s",

                                                 GetSQLValueString($_POST['ck_town'], "text"),

                                                 GetSQLValueString($_POST['ck_manager'], "text"),

                                                 GetSQLValueString($_POST['ck_contact'], "text"),

                                                 GetSQLValueString($_POST['ck_firstname'], "text"),

                                                 GetSQLValueString($_POST['ck_lastname'], "text"),

                                                 GetSQLValueString($_POST['ck_position'], "text"),

                                                 GetSQLValueString($_POST['ck_tel'], "text"),

                                                 GetSQLValueString($_POST['ck_email'], "text"),

                                                 GetSQLValueString($_POST['ck_notes'], "text"),

                                                 GetSQLValueString($_POST['cel_org'], "text"));

                           

                            mysql_select_db($database_tormented3, $tormented3);

                            $Result1 = mysql_query($updateSQL, $tormented3) or die(mysql_error());

                          }

                           

                          if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {

                            $updateSQL = sprintf("UPDATE passwords SET firstname=%s, email=%s WHERE organisation=%s",

                                                 GetSQLValueString($_POST['ck_firstname'], "text"),

                                                 GetSQLValueString($_POST['ck_email'], "text"),

                                                 GetSQLValueString($_POST['cel_org'], "text"));

                           

                            mysql_select_db($database_tormented3, $tormented3);

                            $Result1 = mysql_query($updateSQL, $tormented3) or die(mysql_error());

                          }

                           

                          $colname_rstUpEntry = "1";

                          if (isset($_GET['org'])) {

                            $colname_rstUpEntry = (get_magic_quotes_gpc()) ? $_GET['org'] : addslashes($_GET['org']);

                          }

                          mysql_select_db($database_tormented3, $tormented3);

                          $query_rstUpEntry = sprintf("SELECT * FROM cel_contents WHERE cel_org = '%s'", $colname_rstUpEntry);

                          $rstUpEntry = mysql_query($query_rstUpEntry, $tormented3) or die(mysql_error());

                          $row_rstUpEntry = mysql_fetch_assoc($rstUpEntry);

                          $totalRows_rstUpEntry = mysql_num_rows($rstUpEntry);

                           

                          $colname_rstSix = "1";

                          if (isset($_GET['org'])) {

                            $colname_rstSix = (get_magic_quotes_gpc()) ? $_GET['org'] : addslashes($_GET['org']);

                          }

                          mysql_select_db($database_tormented3, $tormented3);

                          $query_rstSix = sprintf("SELECT * FROM chk_sixmonth WHERE ck_organisation = '%s'", $colname_rstSix);

                          $rstSix = mysql_query($query_rstSix, $tormented3) or die(mysql_error());

                          $row_rstSix = mysql_fetch_assoc($rstSix);

                          $totalRows_rstSix = mysql_num_rows($rstSix);

                           

                          $colname_rstPass = "1";

                          if (isset($_GET['org'])) {

                            $colname_rstPass = (get_magic_quotes_gpc()) ? $_GET['org'] : addslashes($_GET['org']);

                          }

                          mysql_select_db($database_tormented3, $tormented3);

                          $query_rstPass = sprintf("SELECT organisation, firstname FROM passwords WHERE organisation = '%s'", $colname_rstPass);

                          $rstPass = mysql_query($query_rstPass, $tormented3) or die(mysql_error());

                          $row_rstPass = mysql_fetch_assoc($rstPass);

                          $totalRows_rstPass = mysql_num_rows($rstPass);

                          ?>

                          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

                          <html>

                          <head>

                          <title>Admin  Data Update</title>

                          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

                          <link href="../css/mentalhealth_admin.css" rel="stylesheet" type="text/css">

                          <title>TinyMCE Test</title>

                          <script language="javascript" type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>

                          <script language="javascript" type="text/javascript">

                          <!--

                          tinyMCE.init({

                              // General options

                              mode : "textareas",

                              theme : "advanced",

                              plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepo pups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,ful lscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

                           

                              // Theme options

                              theme_advanced_buttons1 : "bold,italic,|,bullist,|",

                              theme_advanced_buttons2 : "",

                              theme_advanced_buttons3 : "",

                              theme_advanced_buttons4 : "",

                              theme_advanced_toolbar_location : "bottom",

                              theme_advanced_toolbar_align : "left",

                              theme_advanced_statusbar_location : "bottom",

                              theme_advanced_resizing : true,

                           

                              // Replace values for the template plugin

                              template_replace_values : {

                                  username : "Some User",

                                  staffid : "991234"

                              }

                          });

                           

                          function MM_findObj(n, d) { //v4.01

                            var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

                              d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

                            if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

                            for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

                            if(!x && d.getElementById) x=d.getElementById(n); return x;

                          }

                           

                          function MM_validateForm() { //v4.0

                            var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

                            for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);

                              if (val) { nm=val.name; if ((val=val.value)!="") {

                                if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

                                  if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';

                                } else if (test!='R') { num = parseFloat(val);

                                  if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';

                                  if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

                                    min=test.substring(8,p); max=test.substring(p+1);

                                    if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

                              } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }

                            } if (errors) alert('The following error(s) occurred:\n'+errors);

                            document.MM_returnValue = (errors == '');

                          }

                          //-->

                          </script>

                          </head>

                           

                          <body>

                          <table width="100%"  border="0" cellspacing="0" cellpadding="2">

                            <tr>

                              <td> </td>

                              <td class="cellcolour"><h3>Admin Page - Content details</h3>

                              </td>

                              <td class="cellcolour"><h4><?php echo $row_rstUpEntry['cel_org']; ?> - Website Entry PK: <?php echo $row_rstUpEntry['cel_pk']; ?></h4></td>

                              <td> </td>

                            </tr>

                            <tr>

                              <td> </td>

                              <td colspan="2" rowspan="10"><form name="form1" method="POST" action="<?php echo $editFormAction; ?>">

                                <table width="100%"  border="0" cellspacing="0" cellpadding="2">

                           

                          etc etc.

                           

                          Thanks again for looking.

                          • 10. Re: Firefox fails to display form content from mysql
                            the_shocker Community Member

                            I wonder if the use of TinyMCE is causing the problem.

                             

                             

                            Captain Obvious just made a comment to me: I wonder if you can remove TinyMCE to test that theory.

                             

                            best,

                            Shocker

                            • 11. Re: Firefox fails to display form content from mysql
                              sudarshan.t CommunityMVP

                              smiffy47 wrote:

                               

                              Thanks for following this up, Sudarshan.

                              Your 2 suggestions in the previous post yielded no improvement.

                              I post below the portion of the webpage that precedes the form quoted above.  I wonder if the use of TinyMCE is causing the problem.

                              We're getting there. What version of TinyMCE are you currently on? 3.5b3 is the latest version and I guess they've resolved the render issue caused with most textboxes in this release as this came out after FF11.

                               

                              If you're not already on 3.5b3, try to upgrade and post your results here.

                              • 12. Re: Firefox fails to display form content from mysql
                                smiffy47 Community Member

                                Yes, Disabling TinyMCE has allowed the textarea to function.  I apologise for not thinking of that earlier.

                                I will now (well perhaps tomorrow) attempt to update TinyMCE.  It's ages since I set it up originally, and will have to study how it functions again.

                                I will post my outcome when I have completed the job.

                                • 13. Re: Firefox fails to display form content from mysql
                                  smiffy47 Community Member

                                  I've been experimenting with the new version of TimyMCE and  initially the new 3.5b3 version made no apparent difference (ie the offending textarea still failed to function whilst the second textarea behaved fine)

                                  I then wondered if there was a problem with having two textareas using a text-editor in one form.  To try this out I deleted the second textarea, which has always functioned fine.  Hey presto, the first textarea sprang into life!  So it appears that whilst I have previously been able to run two (tinyMCE) editable textareas in one form on Firefox I can now only run one.  Does this seem likely to you?

                                  I can see that this maybe turning into an issue for the TinyMCE Forum. .  .

                                  • 14. Re: Firefox fails to display form content from mysql
                                    sudarshan.t CommunityMVP

                                    That's good news.

                                     

                                    To continue having a rich WYSIWYG editor functionality on your site, why dont you consider using CKEditor (formerly FCK Editor)?

                                     

                                    I've implemented this on multiple websites and it works like a charm.

                                     

                                    Please see screenshots:

                                     

                                    The CMS that we built - notice there are 2 textarea editors:

                                     

                                    Screen Shot 2012-04-15 at 11.19.43 AM.png

                                    The Frontend - Notice the content from the backend showing up without a glitch:

                                    Screen Shot 2012-04-15 at 11.20.36 AM.png

                                     

                                    Your scenario and mine are different - but I see this as a possible solution.

                                     

                                    Let us know if this is any good for you.