Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

input type text does not get update until js routine ends

Status
Not open for further replies.
Joined
Mar 7, 2003
Messages
2
Location
US
I have a link on my page - The link below calls a Ticker Symbol lookup javascript routine - The js routine displays 'Please Wait' in a input field & after the routine completes the lookup it then clears the 'please wait'. Thr screen does not get updated however with the please wait - If I put an alert(''); after setting the value I see it - It is as if the screen does not update until the routine completes or an alert occurs - does anyone know how to fix this.

Link
<a href=&quot;javascript:void(tickerSymbolLookup('XX'));&quot; onmouseover=&quot;return changeStatus('Ticker Symbol Lookup');&quot; onmouseout=&quot;return changeStatus('');&quot;>Lookup</a>

Please Wait Input
<input type=&quot;text&quot; name=&quot;lblpleasewait&quot; class=&quot;label&quot; readonly size=&quot;15&quot; value=&quot;&quot; onfocus=&quot;blur();&quot;>


function tickerSymbolLookup(psURL) {
var loAssetForm=document.frmMG;
var xmlhttp = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
var xmlDoc = new ActiveXObject(&quot;Microsoft.XMLDOM&quot;);

var lsSearchURL;
var lsTicker;
var llEquityStyle;
var llFixedIncomeStyle;

frmMG.lblpleasewait.value = 'Please Wait';
//The please wait will only display if I do an alert here

xmlhttp.Open(&quot;POST&quot;,psURL + lsTicker,false);
xmlhttp.send();

xmlDoc.async=&quot;false&quot;;
xmlDoc.loadXML(xmlhttp.responseXML.xml);

document.frmMG.lblpleasewait.value = &quot;&quot;;
 
seems like it should work

try something like this...

document.frmMG.lblpleasewait.value = &quot;Please Wait&quot;
foundVal = document.frmMG.lblpleasewait.value

while (foundVal == &quot;&quot;){
foundVal = document.frmMG.lblpleasewait.value
}

xmlhttp.Open(&quot;POST&quot;,psURL + lsTicker,false);
xmlhttp.send();




Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top