By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,480 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,480 IT Pros & Developers. It's quick & easy.

Redirect Script Compatibility

P: n/a
I don't know much about java scripts, but here is my attempt to write
one. My script allows the user to enter their customer number into a
textbox. When they click on a button, they are redirected to a PDF
file. So if my customer number is 12345, I will be directed to
http://www.websiteaddress.com/reports/12345.pdf whenever I type my
customer number into the textbox.

The script I wrote works with IE 6.0, but when I tested it with
Netscape 4.7, it would not work. I'm not familiar with java scripts
and browser compatibilities. Can someone take a look at my script and
tell me what I need to change in this script to make it compatible
with as many browsers as possible?

Thanks!

<HTML>
<HEAD>
<TITLE>View Report</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function GetReport() {
self.location.href = 'http://www.websiteaddress.com/reports/' +
document.forms[0].txtValue.value + '.pdf';
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<form ID="Form1">
<input type=text name=text1 size=30 ID="txtValue">
<input type=button value="View Report" onClick="GetReport()"
ID="Button1" NAME="btnView">
</form>
</BODY>
</HTML>
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Lee
crjunk said:

I don't know much about java scripts, but here is my attempt to write
one. My script allows the user to enter their customer number into a
textbox. When they click on a button, they are redirected to a PDF
file. So if my customer number is 12345, I will be directed to
http://www.websiteaddress.com/reports/12345.pdf whenever I type my
customer number into the textbox.

The script I wrote works with IE 6.0, but when I tested it with
Netscape 4.7, it would not work. I'm not familiar with java scripts
and browser compatibilities. Can someone take a look at my script and
tell me what I need to change in this script to make it compatible
with as many browsers as possible?


The way that you're referencing the fields actually uses
the NAME attribute, but you're specifying the ID value.
IE lets you get away with many things that other browsers
won't.

They shouldn't really be called "java scripts".
The JavaScript language has nothing to do with the Java language.

Jul 20 '05 #2

P: n/a
Can someone provide an alternative piece of code that will accomplish this?

Thanks for your help!

crjunk

Lee <RE**************@cox.net> wrote in message news:<br*********@drn.newsguy.com>...
crjunk said:

I don't know much about java scripts, but here is my attempt to write
one. My script allows the user to enter their customer number into a
textbox. When they click on a button, they are redirected to a PDF
file. So if my customer number is 12345, I will be directed to
http://www.websiteaddress.com/reports/12345.pdf whenever I type my
customer number into the textbox.

The script I wrote works with IE 6.0, but when I tested it with
Netscape 4.7, it would not work. I'm not familiar with java scripts
and browser compatibilities. Can someone take a look at my script and
tell me what I need to change in this script to make it compatible
with as many browsers as possible?


The way that you're referencing the fields actually uses
the NAME attribute, but you're specifying the ID value.
IE lets you get away with many things that other browsers
won't.

They shouldn't really be called "java scripts".
The JavaScript language has nothing to do with the Java language.

Jul 20 '05 #3

P: n/a
crjunk wrote:
Can someone provide an alternative piece of code that will accomplish this?

[TOFU]


Can you <http://www.netmeister.org/news/learn2quote.html>?
PointedEars
Jul 20 '05 #4

P: n/a
Sorry.

Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in message news:<3F**************@PointedEars.de>...
crjunk wrote:
Can someone provide an alternative piece of code that will accomplish this?

[TOFU]


Can you <http://www.netmeister.org/news/learn2quote.html>?
PointedEars

Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.