473,847 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

stretching javascript to its very limits ( at least I've been told )

I am working on a form in which I have divided onto 5 separate pages (
hopefully for ease of completing ) which employ various field types
such as radio buttons, text and memo fields, a check box or two and
file upload fields.

a self-imposed constraint was to reduce the number of clicks, so I
turned to javascript to automate the process of moving from one page to
another, and would like to ensure this works in both ie and firefox.

having already pondered the use of writing to a cookie, but figured
that the number of people who'll be using the form will have cookies
disabled and far outweighs the 8 - 12% of those who have javascript
disabled and have opted for what I figure to be an easier solution,
which is to pass the variable data to the last page that will be
reviewed before submitting the data.

any assistance, as always, will be appreciated. and if anyone would
like to review the actual pages, just send me an email and I'll be more
than happy to forward them.

onto my first problem:

take the options selected and successfully pass them to the review
page. just can't seem to get them to show up on the page ( this is the
first selction page, central javascript page and the common final (
request review ) page, I still have 4 other pages that will need to
pass variables similarly ).

here's the code I'm using on my first selection page -

<form name="pageOne">

<p>
<input type="radio" name="optionGro upOne"
value="variable OptionOne">vari able option 1
<br />
<input type="radio" name="optionGro upOne"
value="variable OptionTwo">vari able option 2
</p>

<p>
<input type="radio" name="optionGro upOne"
value="variable OptionThree">va riable option 3
<br />
<input type="radio" name="optionGro upOne"
value="variable OptionFour">var iable option 4
</p>

<p>
<input type="radio" name="optionGro upOne"
value="variable OptionFive">var iable option 5
</p>

<p>...and the second option is...</p>

<p>
<input type="radio" name="optionGro upTwo"
value="variable OptionOne">vari able option 1
<br />
<input type="radio" name="optionGro upTwo"
value="variable OptionTwo">vari able option 2
</p>

</form>

here's what I'm trying to do from a centralized javascript page -

function optionSelected ()

var requestType = "";
var server = "";

{

// want the value of the optionGroupOne radio buttton selected
for (var i = 0; i < 4; i++)

{

if
(document.forms['pageOne'].elements['optionGroupOne '][i].checked ==
"true")

{

requestType =
document.forms['pageOne'].elements['optionGroupOne '].value;

} // end if

} // end for

// want the value of the optionGroupTwo radio button selected
for (var i = 0; i < 1; i++)

{

if
(document.forms['pageOne'].elements['optionGroupTwo '][i].checked ==
"true")

{

server =
document.forms['pageOne'].element['optionGroupTwo '].value;

} // end if

} // end for

// open a new window so the variable data can be passed to it
window.open("re viewResults.htm l","Review Your Input");

} // end function

and when I try to retrieve the data on the last page -

<script type="text/JavaScript">

window.document .write(opener.d ocument.optionG roupOne.value);

window.document .write("<p>"+op ener.document.o ptionGroupTwo.v alue+"</p>");

</script>

Nov 23 '05 #1
2 1108

michael wrote:
I am working on a form in which I have divided onto 5 separate pages (
hopefully for ease of completing ) which employ various field types
such as radio buttons, text and memo fields, a check box or two and
file upload fields.

a self-imposed constraint was to reduce the number of clicks, so I
turned to javascript to automate the process of moving from one page to
another, and would like to ensure this works in both ie and firefox.

having already pondered the use of writing to a cookie, but figured
that the number of people who'll be using the form will have cookies
disabled and far outweighs the 8 - 12% of those who have javascript
disabled and have opted for what I figure to be an easier solution,
which is to pass the variable data to the last page that will be
reviewed before submitting the data.

[snip]

How about this idea? If you don't want to use cookies, yet still are
gonna use javascript, then pass the data through the query string
through the various pages. You can use javascript to parse the data at
the end.

Nov 23 '05 #2
VK
web.dev wrote:
How about this idea? If you don't want to use cookies, yet still are
gonna use javascript, then pass the data through the query string
through the various pages. You can use javascript to parse the data at
the end.


Always keeping in mind though the path length limit of 2,083 chars
imposed by Internet Explorer:
<http://support.microso ft.com/default.aspx?sc id=KB;en-us;q208427>

Endless amount of developers already broke over it.

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

136
9492
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
16
3542
by: eben | last post by:
I've been playing with the canvas primitive available in some of the modern browsers, and have put together a little 3d engine that I thought other people might find useful. See http://ajax3d.sourceforge.net/ I'd appreciate any feedback (and an explanation of why it doesn't seem to like Safari). Eben
60
5061
by: marss | last post by:
Maybe anyone know good free online JavaScript knowledge test? This not exactly a system for testing online required - it may be simply list of questions with variants of answers (I have to prepare tests for learners and I need something to be taken as basis). I was able to find only this (http://www.w3schools.com/js/ js_quiz.asp), but I need more. Thanks, Mykola
88
3813
by: santosh | last post by:
Hello all, In K&R2 one exercise asks the reader to compute and print the limits for the basic integer types. This is trivial for unsigned types. But is it possible for signed types without invoking undefined behaviour triggered by overflow? Remember that the constants in limits.h cannot be used.
0
9892
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10996
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10718
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10347
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9497
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7889
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5730
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4133
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3171
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.