<form> re-direct by radio button choice

R

Randy

hi folks,

I've got a guestbook form, one of the fields is a radio button choice
allowing them to subscribe to a newsletter. If this choice is toggled
"yes", I would like the re-direct to go to our newsletter signup page.

Currently I used a linked javascript file for form-checking, which is
triggered by OnSubmit in the <form> tag; and the re-direct is handled by a
hidden input field:

<input type=hidden name="redirect" value="/thankyou.htm">

Is there any way that I could re-direct visitors to a diffeent page if they
clicked "yes" to newsletter subscription?

thanks for any help ....

Randy
 
C

Captain Paralytic

hi folks,

I've got a guestbook form, one of the fields is a radio button choice
allowing them to subscribe to a newsletter.  If this choice is toggled
"yes", I would like the re-direct to go to our newsletter signup page.

Currently I used a linked javascript file for form-checking, which is
triggered by   OnSubmit in the <form> tag; and the re-direct is handled by a
hidden input field:

<input type=hidden name="redirect" value="/thankyou.htm">

Is there any way that I could re-direct visitors to a diffeent page if they
clicked "yes" to newsletter subscription?

thanks for any help ....

Randy

have 2 fields one name redirectyes and the other named redirectno
 
B

Beauregard T. Shagnasty

Randy said:
I've got a guestbook form, one of the fields is a radio button choice
allowing them to subscribe to a newsletter. If this choice is
toggled "yes", I would like the re-direct to go to our newsletter
signup page.

Wouldn't a checkbox be a more logical choice here?

[–] Subscribe to newsletter?

Radio buttons seem more suited to a question similar to this:

(o) E-mail ( ) Snail-mail
Currently I used a linked javascript file for form-checking, which is
triggered by OnSubmit in the <form> tag; and the re-direct is
handled by a hidden input field:

What happens if your visitor has JavaScript disabled, or perhaps blocked
by a NoScript add-on? You can't depend on JavaScript; only your
server-side action script can fully address the processing of the form.
<input type=hidden name="redirect" value="/thankyou.htm">

Your ".htm" suggests you are writing for Microsoft-only browsers...
Is there any way that I could re-direct visitors to a diffeent page
if they clicked "yes" to newsletter subscription?

If you were to reveal what is your server-side scripting language, some
examples of code could be given. In PHP, it might be something like
this:

if ($newsletter=="checked") {
header("location: subscribe.html");
}
 
C

Captain Paralytic

Legacy of MS 8.3 file naming scheme

I still don't understand. non-Microsoft browsers can still access
files called something.htm, so why does happening to want to access a
file called "/thankyou.htm" mean that he is writing for Microsoft-only
browsers?
 
B

Beauregard T. Shagnasty

Captain said:

Okay, perhaps not exactly "for" Microsoft-only browsers, but quite
likely "by" using Microsoft tools. I don't know of any other web tools
that default to the MS-centric file extension of ".htm". Perhaps Randy
is using FrontPage?

And as Jonathan mentioned, .htm was "created" by Microsoft's limited
capability file system.
 
C

Captain Paralytic

Okay, perhaps not exactly "for" Microsoft-only browsers, but quite
likely "by" using Microsoft tools. I don't know of any other web tools
that default to the MS-centric file extension of ".htm".
Who says that anything has defaulted. I sometimes use a .htm extension
when naming files manually, particularly if the server already has
files with similar extensions.

The extension of the file on the server has nothing to do which
browsers might be used to view them.
 
B

Beauregard T. Shagnasty

Captain said:
Who says that anything has defaulted. I sometimes use a .htm
extension when naming files manually, particularly if the server
already has files with similar extensions.

The only people I've ever discussed web creation with who use ".htm"
filenames were all using a Microsoft tool to "write" their sites.
The extension of the file on the server has nothing to do which
browsers might be used to view them.

You are in a nit-picking mood today, eh?
 
J

Jonathan N. Little

Captain said:
I still don't understand. non-Microsoft browsers can still access
files called something.htm, so why does happening to want to access a
file called "/thankyou.htm" mean that he is writing for Microsoft-only
browsers?

I have always used a Netscape|Mozilla browser except for a brief trial
of IE4. If you used a MS product like FrontPlaque or Word or
(gasp)Publisher to make a new HTML document the default extension was HTM

I don't recall, I think it was up to Win2000 I has to tweak the registry
to associated the default extension for HTML Document with HTML and not
HTM hence the rational for BTS's assumption.
 
C

Captain Paralytic

I have always used a Netscape|Mozilla browser except for a brief trial
of IE4. If you used a MS product like FrontPlaque or Word or
(gasp)Publisher to make a new HTML document the default extension was HTM

I don't recall, I think it was up to Win2000 I has to tweak the registry
to associated the default extension for HTML Document with HTML and not
HTM hence the rational for BTS's assumption.


I still don't see what this has to do with the browser!
 
B

Beauregard T. Shagnasty

Captain said:
I still don't see what this has to do with the browser!

Certain Microsoft tools use IE-centric code.

It was an innocuous comment ... let it go.
 
W

William Gill

Okay, perhaps not exactly "for" Microsoft-only browsers, but quite
likely "by" using Microsoft tools. I don't know of any other web tools
that default to the MS-centric file extension of ".htm". Perhaps Randy
is using FrontPage?

And as Jonathan mentioned, .htm was "created" by Microsoft's limited
capability file system.

Beauregard, as a "legacy", I override the default tool settings if
needed, and always used 3 character extensions for consistency. If I
remember that far back .htm was ubiquitous, while .html wasn't, or at
least .htm would work anywhere .html did, but not the other way around.
It insures uniformity in links or references.

Occasionally I will get pages or code from subcontractors using .html,
and I either have to pre-process everything to .htm (or .php) or I add
an entry to .htaccess or httpd.conf.
 
B

Beauregard T. Shagnasty

William said:
Beauregard, as a "legacy", I override the default tool settings if
needed, and always used 3 character extensions for consistency. If I
remember that far back .htm was ubiquitous, while .html wasn't, or at
least .htm would work anywhere .html did, but not the other way
around. It insures uniformity in links or references.

Probably depended on what software your server was using. Apache or
Microsoft IIS ...

Here's an amusing blog post from several years back:
http://jeremy.zawodny.com/blog/archives/000481.html
 
J

Jonathan N. Little

Captain said:
I still don't see what this has to do with the browser!

Generally in the past MS products would create markup that would only
work with MS IE. Those products would default to the truncated extension
HTM. Yes the file extension does not matter to the browser, except IE
;-), but the truncated file extension could indicate OP was using an MS
product for document creation and probably only testing in IE... just a
hunch, how about it OP?
 
J

Jonathan N. Little

Ed said:
Hmm. I seem to recall that Netscape 3's Composer defaulted to .htm.
Hardly a MS product! ;-)

On Windows. You had to tweak the registry to get it to save it with
..html, I know, I did it.
 
D

Denis McMahon

Your ".htm" suggests you are writing for Microsoft-only browsers...

No it doesn't. Three letter file extensions predate microsoft, and due
to their long legacy in computing are widely used.

Rgds

Denis McMahon
 
M

Mike Duffy

Generally in the past MS products would create markup that would
only work with MS IE. Those products would default to the
truncated extension HTM. Yes the file extension does not matter to
.. but the truncated file extension could indicate OP
was using an MS product for document creation and
probably only testing in IE... just a hunch, how about it OP?

I'm not speaking for the OP, but *I* use 3 char extensions exclusively,
(except ".js") and all of my web site was created using textpad (non-
MS), and I always test everything with the latest versions of the 6
most popular browsers. (IE, FF, Opera, Safari, Chrome, Konqueror).

I have also pretty much eliminated browser / feature sniffing, partly
due to advice from "senior" members here & at c.l.j , but mostly
because it always end up making the code more difficult to maintain.
 
R

Randy

all this huff about HTM vs HTML
wow what a way to spend a friday night.
i drank some good aged malt scotch, much better, thanks.

i've always used HTM because to me "short is sweet"
(my girlfriend is short), and I prefer 3-letter file extensions
(yes, I'm an MS-DOS dinosaur).

Browsers never argue, they just do their job.
 
J

Jonathan N. Little

Randy said:
I prefer 3-letter file extensions
(yes, I'm an MS-DOS dinosaur).

Browsers never argue, they just do their job.

Yes, the browser will not care about the file extension, but certainly
will with your approach if it also reflects a "prehistoric" MS-specific
methodology.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,255
Members
46,852
Latest member
CarlaDowle

Latest Threads

Top