文本输入字段在页面重新加载后不反映“值”

文本输入字段在页面重新加载后不反映“值”

问题描述:

My webpage contains the following table (generated from PHP/MySQL):

<table>
    <tr>
        <td valign=top>
            20126/P1010340 (0)<br>
            <input type='text' id='updater0' size=50 type='text' value='100' onBlur='blurEvent0()'><br>
            <input type='button' id='update0' value ='update' onClick='updateEvent0()'>
        </td>
        <td>
            <img src='http://www.pdavis.nl/Ams/20126/P1010340.jpg' width= '300' alt='plaatje'>
        </td>
    </tr>
    <tr>
        <td valign=top>
            20126/P1010343 (1)<br>
            <input type='text' id='updater1' size=50 type='text' value='200' onBlur='blurEvent1()'><br>
            <input type='button' id='update1' value ='update' onClick='updateEvent1()'>
        </td>
        <td>
            <img src='http://www.pdavis.nl/Ams/20126/P1010343.jpg' width= '300' alt='plaatje'>
        </td>
    </tr>
    <tr>
        <td valign=top>
            20126/P1010344 (2)<br>
            <input type='text' id='updater2' size=50 type='text' value='300' onBlur='blurEvent2()'><br>
            <input type='button' id='update2' value ='update' onClick='updateEvent2()'>
        </td>
        <td>
            <img src='http://www.pdavis.nl/Ams/20126/P1010344.jpg' width= '300' alt='plaatje'>
        </td>
    </tr>
    <tr>
        <td valign=top>
            20126/P1010345 (3)<br>
            <input type='text' id='updater3' size=50 type='text' value='400' onBlur='blurEvent3()'><br>
            <input type='button' id='update3' value ='update' onClick='updateEvent3()'>
        </td>
        <td>
            ...
</table>

Each row shows a text field (regulating the order of the .jpgs, preloaded from the database), a button and a .jpg. Pressing the button updates the order parameter (via Ajax and PHP as described here). This all works fine, however... if I reload the page to see the effect of the change in the order of the .jpgs (which is correct), the text field in any rows I had altered, still shows the value I had entered previously by hand, and not the new appropriate value from the database. Thus the page source might show (the new value in the database):

<input type='text' id='updater2' size=50 type='text' value='350' onBlur='blurEvent2()'>

but I see a value of (say) 400 on the actual page. blurEventX only changes the background colour for any values changed by hand.

Upon further investigation, this only occurs in Firefox, and not in Internet Explorer or Google Chrome. It therefore appears to be a browser issue (bug?) and not a problem with the programming.