473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

<form> GETting to an #anchor

Hi,

I'm trying to write a <form> whihc will retrieve a Web page on another
server. I have (essentially) this:

<form action="http://cgi.cs.indiana.edu/~oracle/digest.cgi">
<input type="submit"><select name="N">
<option value="1234#1234-01">foo
<option value="1010#1010-02">bar
<option value="1001#1001-03">baz
</select></form>

The point is that submitting the form will lead the reader to
(respectively)
http://cgi.cs.indiana.edu/~oracle/di...N=1234#1234-01
http://cgi.cs.indiana.edu/~oracle/di...N=1010#1010-02 or
http://cgi.cs.indiana.edu/~oracle/di...N=1001#1001-03

but it doesn't work that way. Instead, the '#' in the <option value> gets
URL encoded. So is there some other way to cause a form to GET to an
anchor on a page?

Tia,

Michael Hamm Since mid-September of 2003,
AM, Math, Wash. U. St. Louis I've been erasing too much UBE.
ms****@math.wustl.edu Of a reply, then, if you have been cheated,
http://math.wustl.edu/~msh210/ Likely your mail's by mistake been deleted.
Jul 20 '05 #1
6 6161
On Mon, 22 Dec 2003 15:37:30 -0600, Michael Hamm declared in
comp.infosystems.www.authoring.html:
I'm trying to write a <form> whihc will retrieve a Web page on another
server. I have (essentially) this:

<form action="http://cgi.cs.indiana.edu/~oracle/digest.cgi">
<input type="submit"><select name="N">
<option value="1234#1234-01">foo
<option value="1010#1010-02">bar
<option value="1001#1001-03">baz
</select></form>


What's wrong with normal links?

<a
href="http://cgi.cs.indiana.edu/~oracle/digest.cgi?N=1234#1234-01">foo</a><
br>
<a
href="http://cgi.cs.indiana.edu/~oracle/digest.cgi?N=1010#1010-02">bar</a><
br>
<a
href="http://cgi.cs.indiana.edu/~oracle/digest.cgi?N=1001#1001-03">baz</a><
br>

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 20 '05 #2
Michael Hamm <ms****@math.wustl.edu> wrote:
I have (essentially) this:

<form action="http://cgi.cs.indiana.edu/~oracle/digest.cgi">
<input type="submit"><select name="N">
<option value="1234#1234-01">foo
<option value="1010#1010-02">bar
<option value="1001#1001-03">baz
</select></form>
The order is somewhat odd, since the choice is made before the
submission. Besides, if this is the whole story, then links would work
better, as Mark Parnell pointed out.
The point is that submitting the form will lead the reader to
(respectively)
http://cgi.cs.indiana.edu/~oracle/di...N=1234#1234-01
http://cgi.cs.indiana.edu/~oracle/di...N=1010#1010-02 or
http://cgi.cs.indiana.edu/~oracle/di...N=1001#1001-03
It won't, because there's no way to add a fragment identifier into the
URL that a GET submission generates. The generated URL consists of the
action URL followed by a question mark and the form's data set in a
particular format, and there's no provision for including a fragment.
(If the action URL contained a fragment, a malformed URL would be
generated, since a fragment, if present, must appear last, by URL
syntax.)
but it doesn't work that way. Instead, the '#' in the <option
value> gets URL encoded.
That's right, and how things are defined.
So is there some other way to cause a
form to GET to an anchor on a page?


You could set up a very simple "intermediator" script that takes the
input from your form and constructs a URL, with a fragment, and
redirects to it. You can then hope that a browser interprets this the
way you want - effectively storing the fragment, sending a request for
the redirect URL, and then positioning the document received, as
specified by the fragment.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #3
On Tue, 23 Dec 2003 00:29:13 +0000 (UTC), Jukka K. Korpela
<jk******@cs.tut.fi> wrote, in part:
I have (essentially) this:

<form action="http://cgi.cs.indiana.edu/~oracle/digest.cgi">
<input type="submit"><select name="N">
<option value="1234#1234-01">foo
<option value="1010#1010-02">bar
<option value="1001#1001-03">baz
</select></form>
The order is somewhat odd, since the choice is made before the
submission.


Yeah, but I think that people are both (a) used to such things and (b)
intelligent enough to figure it out even if unused to such things.
Besides, if this is the whole story, then links would work better, as
Mark Parnell pointed out.
Well, the list is somewhat longer, and takes up too much room on the page
for my liking in this instance.
there's no way to add a fragment identifier into the URL that a GET
submission generates.


Thanks fyi.
So is there some other way to cause a
form to GET to an anchor on a page?


You could set up a very simple "intermediator" script that takes the
input from your form and constructs a URL, with a fragment, and
redirects to it.


Thanks fyi.

Michael Hamm Since mid-September of 2003,
AM, Math, Wash. U. St. Louis I've been erasing too much UBE.
ms****@math.wustl.edu Of a reply, then, if you have been cheated,
http://math.wustl.edu/~msh210/ Likely your mail's by mistake been deleted.
Jul 20 '05 #4
mh***@artsci.wustl.edu (Michael Hamm) wrote:
The order is somewhat odd, since the choice is made before the
submission.
Yeah, but I think that people are both (a) used to such things and
(b) intelligent enough to figure it out even if unused to such
things.


Regarding (a), I don't think such a wrong order is common. Regarding
(b), intelligence does not help if you are blind, for example. After
some failed attempts, the user might figure out what's going on - and
ask himself why the author did something that annoying.
Well, the list is somewhat longer, and takes up too much room on
the page for my liking in this instance.


This is the common "space saving" issue. You save space - the reusable
screen real estate, that is - at the cost of creating accessibility and
usability impediments. For example, how do you open a page in a new
window according to your (i.e., user's) choice when <select> is used?
Right, you don't. Links Want To Be Links, for more than a dozen
reasons, see http://www.cs.tut.fi/~jkorpela/www/links.html

Besides, if you insist on "saving space" - as if it would be a save if
you don't let the user see all the options at a glance when possible -
then using CSS to make a list occupy a "fixed" height (say height:10em)
and to make the content scrollable (overflow: scroll) is a better
approach. It would let links be links.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #5
On Tue, 23 Dec 2003 13:58:24 +0000 (UTC), Jukka K. Korpela
<jk******@cs.tut.fi> wrote, in part:
Well, the list is somewhat longer, and takes up too much room on
the page for my liking in this instance.
<snip> using CSS to make a list occupy a "fixed" height (say height:10em)
and to make the content scrollable (overflow: scroll) is a better
approach.


Ah, thanks, good idea.

Happy holidays,

Michael Hamm Since mid-September of 2003,
AM, Math, Wash. U. St. Louis I've been erasing too much UBE.
ms****@math.wustl.edu Of a reply, then, if you have been cheated,
http://math.wustl.edu/~msh210/ Likely your mail's by mistake been deleted.
Jul 20 '05 #6
On Tue, 23 Dec 2003 13:58:24 +0000 (UTC), Jukka K. Korpela
<jk******@cs.tut.fi> wrote, in part:
Well, the list is somewhat longer, and takes up too much room on
the page for my liking in this instance.
<snip> Besides, if you insist on "saving space" - as if it would be a save if
you don't let the user see all the options at a glance when possible -
then using CSS to make a list occupy a "fixed" height


Another idea (which will work because the text within my list items is
very short, as in the example I posted): I'll use <dir> (in HTML4
Transitional, or <ol class="dir"> in Strict) with
dir{display:block}dir li{display:inline}
dir li + li:before{content:", "}

Then, of course, the problem is whether browsers will display it
correctly. But I suspect the newer ones will. Probably the worst that
would happen would be that a comma would be displayed before the first
item, or no comma would be displayed between any two items -- not the end
of the world in either case.

Michael Hamm Since mid-September of 2003,
AM, Math, Wash. U. St. Louis I've been erasing too much UBE.
ms****@math.wustl.edu Of a reply, then, if you have been cheated,
http://math.wustl.edu/~msh210/ Likely your mail's by mistake been deleted.
Jul 20 '05 #7

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

Similar topics

5
by: Domestos | last post by:
Hi all - please help... using <FORM> HTML tag for user input and need to get get data from it and store in php variable... <input type="text" name="user_name" size="18" maxlength="16"...
2
by: Keiron Waites | last post by:
I have the following code: <input type="text" name="search" class="search_top"> <a href="" onclick="window.location='search.inc.php'+document..search. value; return false;"...
3
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input...
4
by: Howard Jess | last post by:
In Opera 8.01 (Linux; Build 1204) and in Opera 7.54 (Windows XP; Build 3865), my form disappears from the HTML markup (below). To summarize: 1) In a <script> block in the <head> I create a form...
10
by: Phlip | last post by:
HTMListas: (Apologies for I can't Google for this - too many common words.) I have a <form> tag. It thinks I want a <p> break before and after the form. I don't. (My forms are sneaky and...
19
by: Wouter | last post by:
Hi, I try to make when i send a <form> that he dont open a new window. Is there someone who know how i can make this whit javascript ? Greets Wouter
6
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to...
4
by: rob c | last post by:
This is a minor thing and only appears in IE (so far), but I'd like to know to correct it (if possible). Whenever I use a form on a webpage, Explorer always leaves a blank line following the...
10
by: neverquit | last post by:
hi , Iam Nagesh,Begineer in using Ajax,well i have been using ajax in application, i have faced a problem while placing the responseTEXT into the <div> tag positioned inside the <form> tag iam...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.