469,328 Members | 1,301 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

Redirect Script Compatibility

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
4 1248
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
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
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
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.

Similar topics

10 posts views Thread by Bob Garbados | last post: by
2 posts views Thread by Sentinel | last post: by
7 posts views Thread by Donna Hawkins | last post: by
30 posts views Thread by Toni Mcintyre | last post: by
4 posts views Thread by Dave | last post: by
7 posts views Thread by =?Utf-8?B?YzY3NjIyOA==?= | last post: by
1 post views Thread by gnawz | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.