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

Passing form elements from/to HTML pages via JavaScript...

P: n/a
Hello,

I am trying to get all of my form elements passed correctly from the
following URL:
http://www.dslextreme.com/users/kevi...lectBoxes.html
to the following URL:
http://www.dslextreme.com/users/kevi...ctResults.html

I am passing name, email, countries, cities, products, courses, etc.
The others display as they should on the subsequent page,
but the courses retains my loop variable rather than the value as I
would like.

I am concerned that my JS & HTML code function correctly for an
intranet site working in an IE environment only, but I have
a few errors that I am trying to implement (which need fixing):

1) I am getting an error each time I select a different city name.
Could the underscores be an issue for the courses when UK
or US is selected?

2) Should all occurrences of "_" within the code be streamlined
against being used? If so, similarly to the city names code,
should the 'courses' data be an associative array object as well?

3) Another had suggested using a 'dynamic' index for comparison for
the courses data validation on the suggest input box? I
have tried different variations to correct this, but I cannot get it
to work.

These two lines in particular pertain to what was suggested about
using a variation of this replacement code:
if(document.oracle.courses.options[somePassedNdx].value == 'someFlag')

if (data.courses.value == "" || data.courses.options[17].selected) {
if (data.courses.options[18].selected) {

4) Furthermore, how can I resolve my course name also passing for the
results page:

One suggested, "can I pass the associated array text value instead of
the number of the array. Simply, create a hidden field,
pass the text value to the hidden field -- pick up the hidden field in
the receiving page and ignore the passed index."

To no avail I have tried; how do I go about writing the hidden field
portion so that it can populate the results page?

5) For my date select box data validation, I have a portion of it
written near the bottom of the function verifyData(data), but I
am having trouble verifying if the selected date is before or after
the current date. How can I compare the selected date with
today's date so that one doesn't select a date prior to today's?

6) Lastly, if a product is selected before the country is selected and
auto-populates the courses, the courses don't populate
unless a product radio button is reselected. Can this be avoided?

I welcome anyone to review the code from each to see what I can do to
correct things. Can someone assist? Again, the
pages can be viewed from the following URL:
http://www.dslextreme.com/users/kevi...lectBoxes.html

Thanks much,

Kevin
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
And on the day 14 Oct 2003 09:12:16 -0700, ma*********@go.com
enlightened us with <63**************************@posting.google.com>. ..
Hello,

I am trying to get all of my form elements passed correctly from the
following URL:
http://www.dslextreme.com/users/kevi...lectBoxes.html
to the following URL:
http://www.dslextreme.com/users/kevi...ctResults.html


First off, this didn't work at all in IE6/WinXP. Got an error and
couldn't get to the next page at all - couldn't select a course. The
browser has no idea what this is and neither do I.
category = window[selectChoice + "_" + radioChoice];
I get an error when you try to access category.length. Null or not an
object. What are you trying to do here? Your code has no comments.
Trying to decide what you want it to do is not an easy thing.

Also, a bug - when the page is refreshed, the city is still there, but
no cities are listed. To fix that, add the fill to the onload.

<body onload="if(document.oracle.countries.selectedIndex == 0)
document.getElementById('hide').style.display = 'none'; else fillCity
(document.oracle.countries.options
[document.oracle.countries.selectedIndex].value);"><!-- _HEADER_START_
--><!-- _HEADER_END_ -->

There is a function call that I can't find the function...and neither
can my browser.
<SELECT onchange=selectCity(this) size=1 name=cities>
where is the function selectCity()?

Fix that stuff and see if it helps.

--------------------------------------------------
~kaeli~
Kill one man and you are a murderer. Kill millions
and you are a conqueror. Kill everyone and you
are God.
http://www.ipwebdesign.net/wildAtHeart/
http://www.ipwebdesign.net/kaelisSpace/
------------------------------------------------
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.