Re: Javascript to include field on next form



On Sep 30, 4:20 pm, Cov <dcoven...@xxxxxxxxxxx> wrote:
On Sep 29, 11:23 pm, Thomas 'PointedEars' Lahn <PointedE...@xxxxxx>
wrote:





irkl...@xxxxxxxxx wrote:
I've got a short form--1 field and a submit button. I want someone to
enter their name in that field, hit submit, and have their name be in
the "name" field on the next page (which contains a form). Am I even
in the right forum?

For you to be in the right or wrong (Web) forum would require this _public
Usenet newsgroup_ to be a (Web) forum instead. (You are using but a Google
mirror/archive of it.)

However, whether or not your question is off-topic here depends on how you
want to generate the "next page": using client-side J(ava)Script/ECMAScript
for this would be unwise, as that would not degrade gracefully; using
server-side J(ava)Script would be possible.

PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300d...@xxxxxxxxxxxxxxxx>


Are you responding to PointedEars? He didn't ask the question.

I think you have 3 options.

The first would be to use the URL to include the name you want put in
the form:www.myurl.com/mysecondpage.html?John%20Smith

On the second page you could access the URL via document.referrer

That doesn't make any sense. Perhaps you meant
window.location.search?


Another option would be to use frames and access variables from the
parent frame with: parent.inputName

I don't know what that means, but frames are ill-advised in general
and have nothing to do with the OP's question.


And Lastly, you could open the second form with a window with
window.open(). Again the parent variables are accessed through
parent.whatever-the-variable-name.

You are confused. See the FAQ entry about submitting a form to a new
window. Regardless, like frames, new windows have nothing to do with
the question.


These are off the top of my head from when I used to code in
Javascript years ago. The information might be outdated and/or
inaccurate. Sorry.

Inaccurate for sure. It can't be outdated as it was never accurate.
It is nice that you apologized in advance, but it would have been
better to skip posting this entirely.

.


Quantcast