Forum Moderators: open
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled</title>
<script type="text/javascript">
window.onload=function() {
// always use id's and document.getElementById, not name. EASIER! :-)
var frm = document.getElementById('go');
if (frm) {
frm.onsubmit=function() { return convertURL(this,800,700); };
}
};
//
function convertURL(form,w,h) {
var orig_url,day,id,params,full_url,win;
orig_url_field=form.url.value.toUpperCase();
day = new Date();
id = day.getTime();
params = 'width='+w+',height='+h+',scrollbars,resizable';
full_url = 'http://www.example.com/'+orig_url_field.replace( /\s/g, "")+'.pdf';
// for testing
//alert(full_url);
win = open(full_url,id,params);
return false;
}
</script>
</head>
<body>
<form id="go" action="">
<p><input name="url" id="url" type="text"></p>
<p><input type="submit" value="GO"></p>
</form>
</body>
</html>
find a certain word on my webpage. It is a unique word
I know the user can copy and paste the vin # into the form field and click go and it will perform as it should.