Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Trying to combine two scripts and open in a new window


RickB - 7:04 pm on Mar 13, 2012 (gmt 0)


I'm trying to combine these two scripts and get them to open in a new window. Any help / advice that you guys can offer is greatly appreciated. Basicly what I'm trying to do is that once a user imputs the contents into the 1st form field, a second form field will capitalize all the letters from the 1st form field and then convert that part of the form into the url and open the link in a new window. I've been working at this for a while and I can't get this to work correctly.

Here is the first. It works great by itself but for the life of me, I can't get it to open in a new window.

<script>
function convertURL() {
document.go.url.value = document.go.url.value.replace( /\s/g, "");
var url = document.getElementsByName( "url")[0];
var fullurl = document.getElementsByName( "fullurl")[0];
fullurl.value = "http://www.MY-WEBSITE.com/"+ url.value +".pdf";
//msg = document.go.url.value +"?"
//return confirm(msg);
}
</script>
<form name= "go" onsubmit='convertURL();location.href=fullurl.value;return false'>
<input name='url' type='text'/> <input name='fullurl' type='hidden' />
<input type='submit' value="GO" />
</form>


Here is the 2nd.


<script>
function upperMe() {
document.getElementById("output").value = document.getElementById("input").value.toUpperCase();
}
</script>
</head>
<body>
Enter lowercase letters for conversion to uppercase:<br>
<form name="converter">
<input type="text" name="input" id="input"
value="sample" onchange="upperMe()" /><br />
<input type="text" name="output" id="output" value="" />
</form>


Thread source:: http://www.webmasterworld.com/javascript/4428738.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com