HELP!!!! Scrolling Div Problem

Discussion in 'Javascript' started by SMYERS, Sep 4, 2005.

  1. SMYERS

    SMYERS Guest

    Hi...

    Here is my issue and I hope someone can help me here!!!

    I am putting together a logging application, I created a layered dhtml
    popup to position over the parent window. When I call up the details
    of a certain record, in the sql database its type is TEXT and on the
    php side im using echo nl2br($variable);

    When I do that it will inside the scrolling div display 1 line of
    information NO PROBLEM, but lets say I edit the record and put 2 or
    more lines in it... NOPE comes up totally blank, inface the include
    doesnt even seem to load with it... I can strip it all out and do a
    simple echo no problem there so I know the file im including IS
    loading...

    Funny thing is, I can echo the same text 100x no problem, the div will
    scrolll...

    I have searched google all over to no luck, find everything but what I
    am looking for!

    Any help would be greatly apreciated...

    Thanks


    Sample code:

    SQL:
    | entrytext | text | YES | MUL | NULL

    DHTML:
    <SCRIPT LANGUAGE="JScript">
    var engedPopup = window.createPopup();
    function engeditlogs()
    {
    var engedPopBody = engedPopup.document.body;
    engedPopBody.style.backgroundColor = "white";
    engedPopBody.style.border = "solid black 0px";
    engedPopBody.innerHTML = "<div style=\"border : solid 0px #ff0000;
    background : #ffffff; color : #000000; padding : 4px; width : 469px;
    height :244px; overflow : auto;\" \><FONT face=verdana
    size=1><b>Current Details:</b><br><br><? include('eng-edit.php');
    ?></FONT></div>";
    engoPopup.show(505, 188, 470, 250, document.body);
    }
    </SCRIPT>
    (This gets called in the php code... and have verified this is being
    called properly...)
    After that gets called it includes the file you see above and this is
    that files code:

    PHP:
    $id=$_GET[id];
    $incidentno=$_GET[editincident];
    $editincident=$_GET[editincident];
    $clstatus=$_GET[clstatus];
    echo "Engineering Log $incidentno<br><br>";
    mysql_connect("localhost", "root","nissanz");
    mysql_select_db("supportdb");
    $query ="SELECT entrytitle, entrytext, entrydate, soid,
    incidentno, oc";
    $query.=" FROM securityrep WHERE incidentno=$incidentno";
    $result=mysql_query($query);
    while
    (list($entrytitle,$entrytext,$entrydate,$soid,$incidentno, $oc) =$
    mysql_fetch_row($result)) {
    echo "<br>Operator ID: <strong>$soid</strong> - ";
    echo "Call Status: <strong>$oc</strong><br>";
    echo "Date Entered: <b>$entrydate</b><br>";
    echo "Problem: <b>$entrytitle</b><br>";
    echo "<br>";
    echo "<b>Details of problem:</b>";
    PROBLEM----> // echo nl2br($entrytext);


    Ok, if i uncomment that, and the record contains ONLY 1 single line, it
    will display, if it has more then 1 lines 2 or more even, it will now
    display the contents of this include AT ALL.

    Sorry for the long post and thanks again!
     
    SMYERS, Sep 4, 2005
    #1
    1. Advertising

  2. SMYERS wrote:
    > Here is my issue and I hope someone can help me here!!!
    >
    > I am putting together a logging application, I created a layered dhtml
    > popup to position over the parent window. When I call up the details
    > of a certain record, in the sql database its type is TEXT and on the
    > php side im using echo nl2br($variable);
    >
    > When I do that it will inside the scrolling div display 1 line of
    > information NO PROBLEM, but lets say I edit the record and put 2 or
    > more lines in it... NOPE comes up totally blank, inface the include
    > doesnt even seem to load with it... I can strip it all out and do a
    > simple echo no problem there so I know the file im including IS
    > loading...
    >
    > Funny thing is, I can echo the same text 100x no problem, the div will
    > scrolll...
    >
    > I have searched google all over to no luck, find everything but what I
    > am looking for!
    >
    > Any help would be greatly apreciated...

    <snip>

    One of the most useful thing that anyone using a server-side scripting
    language can do is learn to appreciate the separation between what they
    do on the server and what happens on the client.

    What your PHP does (and any other server-side scripting technology does)
    is build an HTTP response that is sent to a client. The client acts
    entirely based on what it receives in that response and it knows nothing
    about the server-side technology that built it.

    If the client does not do what you are expecting with that response
    there is only a limited value in looking at the server-side code that
    created it. It is frequently (indeed almost invariably) more valuable in
    diagnosing unexpected behaviour on the client to be looking at the
    output from the server side code (the actual HTTP response text
    (assuming it is text, rather than binary)), and you most often do this
    be using the 'view-source' facility of the browser.

    In viewing the source that is sent to the browser you should be able to
    see the cause of the issue, and if you cannot see it the odds are good
    that someone here will be able to see it.

    Richard.
     
    Richard Cornford, Sep 4, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. stan
    Replies:
    0
    Views:
    455
  2. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    775
  3. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    206
    David Dorward
    Jun 1, 2005
  4. mscir
    Replies:
    3
    Views:
    334
    Martin Honnen
    Jun 26, 2005
  5. jonyman

    Help needed with scrolling div

    jonyman, Oct 9, 2006, in forum: Javascript
    Replies:
    2
    Views:
    75
    jonyman
    Oct 10, 2006
Loading...

Share This Page