<script language="javascript">
function newUrl()
{
var protocol = document.body.goer.q0.value;
var www = document.body.goer.q1.value;
var strID = document.body.goer.q.value;
var domain = document.body.goer.xyz.value;
var folder = document.body.goer.q2.value;
if (strID == "")
{
window.alert("Please type an domain name.");
}else{
if (strID.indexOf("://") < 1)
{
strID = protocol + www + "." + strID + domain + "/" + folder;
}
if(document.all.item("thisframe").checked==true){parent.header.location = strID;}
else{parent.main.location = strID;
}}}
</script>
<form method="GET" name="goer" id="goer" action="javascript:newUrl();">
<p align="center"><select size="1" name="q0" class="text">
<option selected value=http://www.webdeveloper.com/forum/archive/index.php/"http://">http://</option>
<option value="https://">https://</option>
<option value="ftp://">ftp://</option>
</select><input size="8" name="q1" value="www" class="text" style="text-align: center" >.
<input size="18" name="q" class="text" style="text-align: center"><font size="2"><b><select size="1"
name="xyz" class="text">
<option selected value=".com">.com</option>
<option value=".net">.net</option>
<option value=".org">.org</option>
<option value=".gov">.gov</option>
<option value=".edu">.edu</option>
<option>----------</option>
<option value=".co.uk">.co.uk</option>
<option value=".uk">.uk</option>
<option value=".org.uk">.org.uk</option>
<option value=".gov.uk">.gov.uk</option>
<option value=".edu.uk">.edu.uk</option>
<option value=".ac.uk">.ac.uk</option>
<option>----------</option>
<option value=".net.uk">.net.uk</option>
<option value=".com.uk">.com.uk</option>
<option>----------</option>
<option value=".name">.name</option>
<option value=".be">.be</option>
<option value=".cc">.cc</option>
<option value=".info">.info</option>
<option value=".biz">.biz</option>
<option value=".nu">.nu</option>
</select>/</b><input size="13" name="q2" class="text"><input type="checkbox" name="
thisframe" value="parent.header"></font><font size="1"><b>This
frame</b></font><font size="2">
<input type="submit" value="Load" class="button" style="font-size: 8pt"></font></p>
</form>
The above HTML code shows a page that has form elements that when the user types in the info such as domain name and so on, the user clicks the submit button to load a page in either the same frame or below frame.
TWO problems:
1) Doesn't work (something about the element not being there)
2) I need it to work in Netscape AND IE!!!! Doesnt matter about versions
Please help. I'm sure it's a simple problem
function newUrl()
{
var protocol = document.body.goer.q0.value;
var www = document.body.goer.q1.value;
var strID = document.body.goer.q.value;
var domain = document.body.goer.xyz.value;
var folder = document.body.goer.q2.value;
if (strID == "")
{
window.alert("Please type an domain name.");
}else{
if (strID.indexOf("://") < 1)
{
strID = protocol + www + "." + strID + domain + "/" + folder;
}
if(document.all.item("thisframe").checked==true){parent.header.location = strID;}
else{parent.main.location = strID;
}}}
</script>
<form method="GET" name="goer" id="goer" action="javascript:newUrl();">
<p align="center"><select size="1" name="q0" class="text">
<option selected value=http://www.webdeveloper.com/forum/archive/index.php/"http://">http://</option>
<option value="https://">https://</option>
<option value="ftp://">ftp://</option>
</select><input size="8" name="q1" value="www" class="text" style="text-align: center" >.
<input size="18" name="q" class="text" style="text-align: center"><font size="2"><b><select size="1"
name="xyz" class="text">
<option selected value=".com">.com</option>
<option value=".net">.net</option>
<option value=".org">.org</option>
<option value=".gov">.gov</option>
<option value=".edu">.edu</option>
<option>----------</option>
<option value=".co.uk">.co.uk</option>
<option value=".uk">.uk</option>
<option value=".org.uk">.org.uk</option>
<option value=".gov.uk">.gov.uk</option>
<option value=".edu.uk">.edu.uk</option>
<option value=".ac.uk">.ac.uk</option>
<option>----------</option>
<option value=".net.uk">.net.uk</option>
<option value=".com.uk">.com.uk</option>
<option>----------</option>
<option value=".name">.name</option>
<option value=".be">.be</option>
<option value=".cc">.cc</option>
<option value=".info">.info</option>
<option value=".biz">.biz</option>
<option value=".nu">.nu</option>
</select>/</b><input size="13" name="q2" class="text"><input type="checkbox" name="
thisframe" value="parent.header"></font><font size="1"><b>This
frame</b></font><font size="2">
<input type="submit" value="Load" class="button" style="font-size: 8pt"></font></p>
</form>
The above HTML code shows a page that has form elements that when the user types in the info such as domain name and so on, the user clicks the submit button to load a page in either the same frame or below frame.
TWO problems:
1) Doesn't work (something about the element not being there)
2) I need it to work in Netscape AND IE!!!! Doesnt matter about versions
Please help. I'm sure it's a simple problem