Stupid question

I

Ian

Hi all

Sorry, but this is probably the most stupid question you've come across in
here in a long time.

I have a form that submits.

If I use this: <button name="submit" value="Submit"
type="submit">Submit</button>

it works

If I use this: <input name="submit" style="width:126px; height:49px;"
type="image" src="images/sendup.gif"
onmouseover="this.src='images/senddown.gif'"
onmouseout="this.src='images/sendup.gif'" />

it works.

I am *trying* (for presentational purposes) to use a link from within a Spry
menu. I have tried everything I can find on the Web (href=blah, blah;
onclick=blah, blah - and that includes things like 'this.',
javascript:document, etc, etc. I've also tried '<input' etc, as the value
for the link) but it will not do it. The link is within the form to be
submitted and the form name is 'contactform'.

Any free clues will be *most* appreciated, as I've spent the best part of a
day (probably going around in circles) trying to get this to work, and I
suspect I'm about to get a rather large bill from Google. :)

TIA

Ian
 
J

Jukka K. Korpela

Ian said:
Sorry, but this is probably the most stupid question you've come
across in here in a long time.

Well, the Subject line is surely very stupid.
I have a form that submits.

It was stupid not to specify the URL of your page.
If I use this: <input name="submit" style="width:126px; height:49px;"
type="image" src="images/sendup.gif"
onmouseover="this.src='images/senddown.gif'"
onmouseout="this.src='images/sendup.gif'" />

it works.

For some values of "works". Did you test it with image loading switched off,
or a speech-based browser?
I am *trying* (for presentational purposes) to use a link from within
a Spry menu.

"Spry"? Is that something edible? And why would you use a link for
submitting a form?
The link is within
the form to be submitted and the form name is 'contactform'.

Yeah, right. A link _instead of_ a form might be a good idea. Actually, just
telling an email address as contact info tends to be superior to most
"contact forms", which usually allocate a stamp-size area for the user's
message.
Any free clues will be *most* appreciated

Free clue: Think about the user who might wish to contact someone, not your
fancy ideas of what a "contact form" should look like to make an impression.
 
I

Ian

Jukka K. Korpela said:
Ian wrote:


It was stupid not to specify the URL of your page.

Is it? And just how do you think you are going to reach it on the H drive of
Laptop2?
For some values of "works". Did you test it with image loading switched
off, or a speech-based browser?

Sorry, I didn't explain myself very well and I will rephrase that: it
*submits*; it goes through the code that is called by 'form onsubmit'. I
hope that is clearer.
"Spry"? Is that something edible? And why would you use a link for
submitting a form?

If you do not know what 'Spry' is, besides being a (I think) now obsolete
brand of lard, then I am not sure why you are posting in alt.html.
Yeah, right. A link _instead of_ a form might be a good idea. Actually,
just telling an email address as contact info tends to be superior to most
"contact forms", which usually allocate a stamp-size area for the user's
message.

I might not be very good at this but I am aware of an email address that can
be phished and I am also aware of mailto. They also tell me that size
doesn't matter. :)
Free clue: Think about the user who might wish to contact someone, not
your fancy ideas of what a "contact form" should look like to make an
impression.

Never mind what *my* ideas might be, never mind what users might (in *your*
opinion) want, I was asking a programming-related question. If you have no
constructive ideas as to the answer then I suggest it would be better if you
didn't waste bandwidth.

Regards

Ian
 
J

Jukka K. Korpela

Ian said:

It was. And you add to the stupidity by not taking the advice.
And just how do you think you are going to reach it on the H
drive of Laptop2?

Oh, I'm sure you computer's protection wouldn't make it too difficult.

Just how do you think you are going to use your page if you don't know how
to upload it onto a web server?
Sorry, I didn't explain myself very well and I will rephrase that: it
*submits*; it goes through the code that is called by 'form
onsubmit'. I hope that is clearer.

Thank you for answering my question, though indirectly.
If you do not know what 'Spry' is, besides being a (I think) now
obsolete brand of lard, then I am not sure why you are posting in
alt.html.

Oh, maybe just because I understand HTML.
I might not be very good at this but I am aware of an email address
that can be phished and I am also aware of mailto.

I agree that you are not very good at web authoring, but ignorance is
curable, though usually not against the patient's will.

If you have swallowed all the crap they talk about "spam protection" by
obfuscating human communication, yet apparently use a real email address
when posting the Usenet (which was always correct practice), then surely
someone is taking care of spam filtering for that address. So why don't you
find out how to do that for the business adress you would announce on a web
page?
Never mind what *my* ideas might be, never mind what users might (in
*your* opinion) want, I was asking a programming-related question.

Why don't you ask it in a programming newsgroup? Well, perhaps because you
don't know what programming is, and what programming language you might be
using.

But you asked for a clue, and I gave one.
 
1

123Jim

Ian said:
Is it? And just how do you think you are going to reach it on the H drive
of Laptop2?


Sorry, I didn't explain myself very well and I will rephrase that: it
*submits*; it goes through the code that is called by 'form onsubmit'. I
hope that is clearer.


If you do not know what 'Spry' is, besides being a (I think) now obsolete
brand of lard, then I am not sure why you are posting in alt.html.


I might not be very good at this but I am aware of an email address that
can be phished and I am also aware of mailto. They also tell me that size
doesn't matter. :)


Never mind what *my* ideas might be, never mind what users might (in
*your* opinion) want, I was asking a programming-related question. If you
have no constructive ideas as to the answer then I suggest it would be
better if you didn't waste bandwidth.

Regards

Ian

I have an idea why this group is so low on traffic.
Newsgroup rage strikes again ;)
I think what brings it on is when they read a news post that they do not
fully understand. Instead of trying to figure it out, or ask for
clarification in a civilised way, respondents to this group, are filled with
NNTP rage and feel compelled to respond in the most condescending, rude and
humourless way possible. It makes me wonder if they go on like this face to
face in the real world. Does nntp bring out the worst in people? or does it
shine an unforgiving bright light on their real characters?

Anyway I apologise for rambling off topic ... I did not understand your
question either, but I'm not going off the deep end, like the guy who threw
his computer out the window.

Maybe you can upload an example?
 
A

Andy

Ian said:
Hi all

Sorry, but this is probably the most stupid question you've come across in
here in a long time.

I have a form that submits.

If I use this: <button name="submit" value="Submit"
type="submit">Submit</button>

it works

If I use this: <input name="submit" style="width:126px; height:49px;"
type="image" src="images/sendup.gif"
onmouseover="this.src='images/senddown.gif'"
onmouseout="this.src='images/sendup.gif'" />

it works.

I am *trying* (for presentational purposes) to use a link from within a
Spry menu. I have tried everything I can find on the Web (href=blah, blah;
onclick=blah, blah - and that includes things like 'this.',
javascript:document, etc, etc. I've also tried '<input' etc, as the value
for the link) but it will not do it. The link is within the form to be
submitted and the form name is 'contactform'.

Any free clues will be *most* appreciated, as I've spent the best part of
a day (probably going around in circles) trying to get this to work, and I
suspect I'm about to get a rather large bill from Google. :)

TIA

Ian


Hi Ian,

Not entirely sure what you're after, but it sounds like you want a standard
link to submit your form.

Here's one possible solution for you...

<script language="JavaScript" type="text/javascript">
<!-- SUBMIT FORM
function submit_form(){
document.contactform.submit();
}
// - End of JavaScript - -->
</script>

<a href="javascript: submit_form()" title="Click to submit">Your Submit
Link</a>

....hope this helps.


Andy
 
J

Jukka K. Korpela

Andy said:
- -
Not entirely sure what you're after

It's obvious that he's after something stupid. It was specified in the
Subject line.
but it sounds like you want a
standard link to submit your form.

There is no standard link to submit a form. You have apparently tweaked the
meanings of "standard" and "link" quite a lot.
<script language="JavaScript" type="text/javascript">
<!-- SUBMIT FORM

So you are trying to protect against some Netscape 1 features with the HTML
pseudocomment idea, but you simultaneously create a trap, since the OP's
HTML fragment used XHTML notation. In XHTML, the pseudocomment is a real
comment, and browsers are allowed to remove comments before processing the
data further. Maybe the OP deserves that, but you're misleading others, too.
<a href="javascript: submit_form()" title="Click to submit">Your
Submit Link</a>

...hope this helps.

You have helped to replace a simple, robust submit button by an element that
looks like link but isn't and that does not do anything (except perhaps
trigger an error message) when JavaScript execution is disabled or suitably
filtered.

Actually, anyone who googles for a minute or so is bound to find this poor
technique (using not-so-hard-to-invent key words like javascript form
submit), so it's quite possible that the OP wanted some more thorough
destruction o robustness and usability.
 
T

Tim Streater

"Ian said:
Almost time to invoke Godwin's Law. :)


I couldn't possibly comment. :)

I'd suggest you ignore Yucky. He seems to be one of these people who
feels that you shouldn't be allowed to ask simple questions in this ng -
they have to be deep, meaningful, and erudite.
I thought I had done that in my first post. Seems not. :)

<button name="submit" value="Submit" type="submit">Submit</button> - this
works and triggers the submit process

So this is a button within the form, then? So you click it and the form
submits.
<input name="submit" /> - [styling deleted for the purists] this works and
triggers the submit process

This is less clear. What do you *do* to trigger the submit?
I'm *trying* to get something like the following to work:

<a href="#" onclick="document.contactform.submit()">Submit</a>

What about:

<a href="javascript:document.contactform.submit();">Submit</a>

although that may be wrong too - at this time of the morning and with a
bad cold I'm not sure. Where is this <a> in relation to the form?
 
R

Roy A.

A button is not a "replaced element" like an input. It gets its grey
background from the browser default stylesheet and all that can be
completely overridden by CSS to which it is just an element like any
other.

If you have more than one submit button in a form, you will have
problems with Intranet Explorer, at least IE6.

IE6 will submit the content of the button element, instead of the
content of the value attribute.

The post data received by the server could give you a headache. The
value for the submit name could contain html, if the user are using
IE, or a plain value if the user are using e.g. Firefox.

I have no idea why they do it like that, and what the benefit is.
 
T

Tim Streater

"Ian said:
That's one of many scenarios I've tried, and why I posted here. I thought
that it *should* work, and it doesn't. I've tried 20 or 30 things in there.


It's a single button Spry menu on the form. I was just trying to reuse the
styling that I already have, rather than have to do it all over again. So,
it's in <ul><li>foo</li></ul>

Mmmm ...

Trouble is, I know nothing about Spry. In fact, I hadn't heard of it
either although I've now seen what it is. Does your browser have a
debugger which might tell you something?

I take it by "single button Spry menu" you mean a clickable Spry entity
behind which you want your <a> to work, rather than an "<input
type='button' ..." ?
 
J

Jukka K. Korpela

Ben said:
A button is not a "replaced element" like an input. It gets its grey
background from the browser default stylesheet and all that can be
completely overridden by CSS to which it is just an element like any
other.

Wrong. You're forgetting the usual CSS Caveats, which apply unusually
strongly to form fields.

(You can do many things to make a button look like a link. This is generally
counter-productive, but it can be done. Just not "completely" and "like any
other".)

The OP deserves no good advice, due to continued refusal to tell what he is
trying to do and to really show it with a URL, but we shouldn't mislead
others who might be reading this thread, for various odd reasons.
 
B

Beauregard T. Shagnasty

Ian said:
[biggasnip]
I thought I had done that in my first post. Seems not. :)

<button name="submit" value="Submit" type="submit">Submit</button> -
this works and triggers the submit process

<input name="submit" /> - [styling deleted for the purists] this
works and triggers the submit process

I'm *trying* to get something like the following to work:

<a href="#" onclick="document.contactform.submit()">Submit</a>

I've tried everything I could find online and it doesn't work.

I don't see anywhere in this thread that you actually tried to use a
normal form submit button, such as in this abbreviated example:

<form method="post" action="[action script filename here]">
[rest of form input items here]
<input type="submit" value=" Submit Form ">
Hope that's a bit clearer?

No, not really. As mentioned by others, an example URL to what you
actually want to do would help.
 
D

Doug Miller

I do know how to upload it onto a server.[/QUOTE]

Then might I suggest that you do so? It's difficult to help you if you won't
put the code someplace where the rest of us can see it.
[...]
So alt.html isn't a ng for questions about programming in html?

No, it's not. Hint: HTML is not a programming language; hence, there is no
such thing as "programming in HTML".
 
T

Tim Streater

"Jukka K. Korpela said:
The OP deserves no good advice, due to continued refusal to tell what he is
trying to do and to really show it with a URL, but we shouldn't mislead
others who might be reading this thread, for various odd reasons.

So you're going to give him bad advice, then, eh? You fool, of course he
deserves good advice, otherwise what is the point of this ng?

If you're saying that the OP could help himself better by explaining a
bit more, that's probably true, but that is a problem for anyone asking
a question in circumstances where they are slightly confused. And if
they weren't confused then they wouldn't need to ask.

A good teacher, such as you appear not to be, has to learn the skill of
asking the right questions to tease out what is actually going on (which
the poster may not know) and then explaining back to them what they have
just said. This does not excuse people from doing their own research
first, of course.

Now, are you going to help the OP, keep quiet, or continue to be a waste
of space?

Oh, and on the question of a URL, here's the one to my stuff that I'm
developing:

http://localhost/myapp/myapp-main.html

Feel free to take a look and point out all my errors.
 
D

Doug Miller

I thought I had done that in my first post. Seems not. :)

No, actually, you didn't. You posted a snippet of markup. "Upload an example"
means exactly that: upload an entire page demonstrating the problem to a web
server where the rest of the world can see it.
 
R

Roy A.

So you're going to give him bad advice, then, eh? You fool, of course he
deserves good advice, otherwise what is the point of this ng?

What is the point of "X-No-Archive: yes"?
 
J

Jukka K. Korpela

Roy said:
What is the point of "X-No-Archive: yes"?

It accurately tells that the messages are not worth being archived, though
one may wonder why anyone thought they were worth sending in the first
place.

It also acts as a cluelessness signal, since it normally does _not_ prevent
archiving - it just implies that the message will only be archived in parts
appearing in quotations. So if someone quotes such a message out of context
or in distorted form, the quoting message will be available in archives but
the original message, showing the whole text and with original headers, will
not.

ObHTML: This is remotely comparable to using <meta> tags to exclude robots
just because you have odd feelings about some software processing your
texts.
 
J

Jukka K. Korpela

Ben said:
Where in "the usual CSS Caveats" does it say you can't style buttons
how you like?

Item #9.
I know of no style that works on, say, SPAN but not on BUTTON
in any half-reasonable browser (Firefox, Safari, Opera, Konqueror).

Maybe you don't know them well enough. More importantly, you should get
acquainted with the most commonly used browser.
 
J

Jeremy J Starcher

I thought I had done that in my first post. Seems not. :)

<button name="submit" value="Submit" type="submit">Submit</button> -
this works and triggers the submit process

<input name="submit" /> - [styling deleted for the purists] this works
and triggers the submit process

I'm *trying* to get something like the following to work:
<a href="#" onclick="document.contactform.submit()">Submit</a>

First, just in good faith, I'll explain why it isn't working ...
Then what it takes to make it work, then why you shouldn't do it.

Somewhere after your onload event, try this:
alert(typeof document.contactform);

Should be undefined.

The correct syntax is:
document.forms['contactform'].submit();

Assuming that 'contactform' is indeed the correct *name* of the form and
isn't an ID or something. Hence, the lack usable URL limits the answer I
am capable of giving.

Now ... that said...
Don't.

Doesn't work with Javascript disabled ... breaks user expectation about
what happens when you follow it ... (back button doesn't behave the same
way when returning from a form as it does when returning from a link)
etc, etc.


PS: I had no idea what 'Spry' was until I went searching for it. There
are a number of coders who maintain their own personal libraries and
functions and don't reply upon external packages of ... dubious quality.
Spry is what... just one Ajax type frame work .. one of hundreds?
Thousands?
 

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
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top