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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change URL in an other widow using a button ?

Status
Not open for further replies.

Fabrice

Technical User
Apr 20, 2000
1
CH
Hello people,<br><br>I have a Popup with this link:<br>&lt;a href=&quot;xxx.htm&quot; target=&quot;main_page&quot;&gt;Click Me&lt;/a&gt;<br>and when I click on the link, the URL of my main page change. That's Ok, but ...<br><br>I want to replace it by a button using a Javascript function like that:<br><br>&lt;&lt;...<br>function click_me()<br>{&nbsp;&nbsp;document.main_page.location=&quot;xxx.htm&quot;&nbsp;&nbsp;}<br>...<br>&lt;p&gt;&lt;input type=&quot;button&quot; name=&quot;test_link&quot; value=&quot;Click Me&quot; onClick=&quot;click_me()&quot;&gt;&lt;/p&gt;<br>..&gt;&gt;<br><br>And when I click on button, nothing append !?!<br>Can someone help me ?<br><br>Thanks in advance<br>Fabrice<br>
 
Link like this:<br>&lt;a href = &quot;javascript:popupNewWindow('main_page', 'xxx.htm');&quot;&gt;...&lt;/a&gt;<br><br>and this:<br>&lt;input type=&quot;button&quot; name=&quot;test_link&quot; value=&quot;Click Me&quot; onClick=&quot;click_me('xxxtest.htm')&quot;&gt;<br><br><br>two functions:<br>&lt;script language = &quot;javascript&quot;&gt;<br>&lt;!--<br>&nbsp;&nbsp;function popupNewWindow(WindowName, TargetURL)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;var NewWindow;<br>&nbsp;&nbsp;&nbsp;&nbsp;NewWindow = open(TargetURL, WindowName);<br>&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;function clickMe(TargetURL, WindowName)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;WindowName.navigate(TargetURL);&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;}<br>//--&gt;<br>&lt;/script&gt;<br><br>basically, you're looking for the Window.Navigate() method. hope that helped. <br>-Packet
 
I'm just curious as to your reasoning for wanting to do this, if you don't mind me answering. <p>REH<br><a href=mailto:hawkdogg@crosswinds.net>hawkdogg@crosswinds.net</a><br><a href= by Linux</a><br>Learn Linux and Leave out the Windows :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top