Click to See Complete Forum and Search --> : Javascript box with choices


Multicase
04-03-2003, 07:49 AM
Hi !

I've made a Javascript Link box.
The admins can make new articles and in admin view they can also put in LINKS in the text.

To make LINK they have to mark the text they want the link to work with and the press a button called : LINK.
Then a popupbox apears where they must type in the HTTP for the link.
When link is made the link opens in DEFAULT = NEW BROWSER WINDOW.

How can I make a radiobutton/checkbox in the link popupbox so that, if you select that radiobutton/checkbox the link you have typed in ahead will open in _SELF .. in the same window which allready is opened.

PLZ HELP !

Jona
04-03-2003, 12:46 PM
Prompts cannot contain form elements. Unless you mean on the page that prompts you want an if(radiobutton_one is checked) sort of function...

Multicase
04-04-2003, 12:08 AM
Yes that is the function im after...

Plz explain how to make that happen...

Jona
04-04-2003, 12:19 AM
Something like this:

<html><head>
<script>
function foo(){if(document.f1.elements[0].selected){ window.open("file.html");}else{location="file.html";} }
</script>
</head><body><form name="f1">
Open in:<br>
new window <input type=radio name="rio"><br>
same window <input type=radio name="rio"><br>
<input type=button value="Open" onClick="foo()">
</form></body></html>

Multicase
04-04-2003, 12:26 AM
Thank you fro your help!