Problem on IE refreshing form elements values

Discussion in 'Javascript' started by odgarro, Jun 22, 2006.

  1. odgarro

    odgarro Guest

    Hi,
    I have this problem I can´t solve.

    I´m using some mix of javascript / php / ajax code to open a text
    file, process its info and close it.

    While skiping through the text file lines, I´d like some of myForm
    elements be updated with the info extracted from the file.

    This way, the user realice that actually some process is being executed
    and forgets about "oh ! this isn´t working, I'll try closing and
    opening the app again".

    Here is some part of the HTML code:

    <FORM name="myForm" id="myForm" method="POST" >

    <INPUT type="text" name="employee" id="employee">

    <INPUT type="button" name="btnProcess" id="btnProcess"
    onclick="xajax_ProcessFile();" >

    </FORM>

    and part of my ProcessFile() php function should look like:

    $h = fopen($file_name,"rb") ;

    while( ($fld = fgetcsv($h, 35," ")) !== FALSE ) {
    $emp = $fld[0] ;

    $objResponse->addScript("document.getElementById('employee').value='$emp';");
    }
    fclose($h);
    return $objResponse->getXML();

    Now... on Mozilla/FireFox this works just like I expect.
    As the function skips through the text file lines, the value of
    myForm.employee.value is updated with some text of the line being
    processed.
    But, on IE nothing happens until the function reachs the end of the
    text file (when the last record do appears on myForm.employee.value )
    So, on both navigators my function reaches its propose (that is to
    process the text file) but on IE the info is not shown on the form
    while processing.

    Any idea ???
    odgarro, Jun 22, 2006
    #1
    1. Advertising

  2. odgarro

    James Black Guest

    odgarro wrote:

    > Now... on Mozilla/FireFox this works just like I expect.
    > As the function skips through the text file lines, the value of
    > myForm.employee.value is updated with some text of the line being
    > processed.
    > But, on IE nothing happens until the function reachs the end of the
    > text file (when the last record do appears on myForm.employee.value )
    > So, on both navigators my function reaches its propose (that is to
    > process the text file) but on IE the info is not shown on the form
    > while processing.


    I believe IE waits to display the page until it is all rendered.

    You could just use XmlHttpObject to get the textfile from your
    server, then parse it in the javascript, and show what you want, as an
    update.
    James Black, Jun 22, 2006
    #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. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    445
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  2. Aitham alama
    Replies:
    1
    Views:
    101
    Harold S
    Jul 12, 2004
  3. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    179
    Harlan Messinger
    Aug 3, 2006
  4. Shekhar
    Replies:
    0
    Views:
    180
    Shekhar
    Jul 16, 2004
  5. Replies:
    4
    Views:
    178
Loading...

Share This Page