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

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

P: n/a
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="optionGroupOne"
value="variableOptionOne">variable option 1
<br />
<input type="radio" name="optionGroupOne"
value="variableOptionTwo">variable option 2
</p>

<p>
<input type="radio" name="optionGroupOne"
value="variableOptionThree">variable option 3
<br />
<input type="radio" name="optionGroupOne"
value="variableOptionFour">variable option 4
</p>

<p>
<input type="radio" name="optionGroupOne"
value="variableOptionFive">variable option 5
</p>

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

<p>
<input type="radio" name="optionGroupTwo"
value="variableOptionOne">variable option 1
<br />
<input type="radio" name="optionGroupTwo"
value="variableOptionTwo">variable 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("reviewResults.html","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.document.optionGroupO ne.value);

window.document.write("<p>"+opener.document.option GroupTwo.value+"</p>");

</script>

Nov 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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

P: n/a
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.microsoft.com/default.aspx?scid=KB;en-us;q208427>

Endless amount of developers already broke over it.

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.