943,701 Members | Top Members by Rank

Ad:
Oct 31st, 2008
0

Javascript onclick events problem

Expand Post »
Hello all,

I have this code in an iframe

html Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 7
Solved Threads: 2
Light Poster
komrad is offline Offline
39 posts
since Sep 2006
Nov 1st, 2008
0

Re: Javascript onclick events problem

Am not sure if this is what you need.
html Syntax (Toggle Plain Text)
  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>
Featured Poster
Reputation Points: 114
Solved Threads: 138
Posting Shark
essential is offline Offline
973 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Change the background of "active" button
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: A text hiperlink on image





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC