Forum Moderators: open

Message Too Old, No Replies

Reloading only part of a page?

reloading, reload, refresh

         

Tim_Mousel

8:12 am on Jan 17, 2007 (gmt 0)

10+ Year Member



<img src="randomImage3.php" alt="Verification Number" align="absmiddle" /><input name="button" type="button" onclick="window.location.reload()" value="New Code!" />

How would I make that reload without reloading the entire page?

Thanks in advance.

Trace

4:32 pm on Jan 17, 2007 (gmt 0)

10+ Year Member



This should work;

<img src="randomImage3.php" alt="Verification Number" align="absmiddle" id="thisImage" /><input name="button" type="button" onclick="document.getElementById('thisImage').src='randomImage3.php';" value="New Code!" />

Tim_Mousel

11:33 pm on Jan 17, 2007 (gmt 0)

10+ Year Member



Hi,

Thanks for your reply. I tried that in both Firefox and IE7 and there was no response. Any ideas?

Thanks!

Trace

3:45 pm on Jan 18, 2007 (gmt 0)

10+ Year Member



This is an exact copy of what I just tried;

<img src="logo1.gif" alt="Verification Number" align="absmiddle" id="thisImage" /><input name="button" type="button" onclick="document.getElementById('thisImage').src='logo2.gif';" value="New Code!" />

It works for me. The only difference is I'm actually trying it with images and not a php script. I can't help you with the php stuff, sorry.

Tim_Mousel

4:45 pm on Jan 18, 2007 (gmt 0)

10+ Year Member



Hi,

Not sure why it gave me a problem. This is what I ended up using:

  <img src="randomImage3.php" id='randImage2' alt="Verification Number" align="absmiddle" /> <input name="button" type="button" onclick="document.getElementById('randImage2').setAttribute('src', 'randomImage3.php?r='+ Math.floor(Math.random() * 5000));" value="New Code!" />

Tim_Mousel

4:45 pm on Jan 18, 2007 (gmt 0)

10+ Year Member



...and, thanks again.