By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

Problem on IE refreshing form elements values

P: n/a
Hi,
I have this problem I cant solve.

Im 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, Id 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 isnt 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').va lue='$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 ???

Jun 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
odgarro wrote:
Hi,
I have this problem I cant solve.

Im 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, Id 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 isnt 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').va lue='$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 ???


Wouldn't this be better handled on comp.lang.javascript, it really isn't
anything to do with PHP
Jun 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.