Javascript onclick events problem

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Sep 2006
Posts: 22
Reputation: komrad is an unknown quantity at this point 
Solved Threads: 1
komrad's Avatar
komrad komrad is offline Offline
Newbie Poster

Javascript onclick events problem

 
0
  #1
Oct 31st, 2008
Hello all,

I have this code in an iframe

  1. <FORM><INPUT TYPE="BUTTON" VALUE="Go Back"
  2. ONCLICK="history.go(-1)"></FORM>

it works fine but i need it to taget another iframe on the page and change that iframe and go back in its own iframe

Thanks in advance.
Last edited by peter_budo; Nov 2nd, 2008 at 5:46 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 954
Reputation: essential will become famous soon enough essential will become famous soon enough 
Solved Threads: 131
Featured Poster
essential's Avatar
essential essential is offline Offline
Posting Shark

Re: Javascript onclick events problem

 
0
  #2
Nov 1st, 2008
Am not sure if this is what you need.
  1. <!-- Assuming that this the targeted frame in your page -->
  2. <iframe id="frame1" src="myPage.html" width="700" height="700"></iframe>
  3.  
  4. <FORM><INPUT TYPE="BUTTON" VALUE="Go Back"
  5. ONCLICK="document.getElementById('frame1').contentWindow.location = 'someLocation.html';"></FORM>
  6.  
  7. <!-- Just another option -->
  8.  
  9. <FORM><INPUT TYPE="BUTTON" VALUE="Go Back"
  10. ONCLICK="document.getElementById('frame1').src = 'someLocation.html';"></FORM>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC