473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 1327
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
2
by: Sentinel | last post by:
here is the entire thread From: "Kimmo Laine" <eternal.erectionN0.5P@Mgmail.com> Subject: Re: script in body Date: Mon, 20 Jun 2005 17:46:28 +0300 Message-ID:...
6
by: Tim Stokes | last post by:
Hi all, I want to do a similar action to response.redirect ("file.htm"). But the file.htm contains some sensitive data. I have placed file.htm in a folder in the InetPub...
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
30
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript>...
7
by: ndessai | last post by:
Hi All, I discovered following issue with the VC 7.1 compiler regarding the backword compatibility. I created a dll (Redirect.dll) which exposes a function and simply writes some text (say...
4
by: Dave | last post by:
Is there a way to do a Response.Redirect and do a popup on the redirect?
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
1
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.