Stupid question

P

Peter

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. :)

Well what has worked for me, especially with multiple forms on a page
is...

<form name = "name_of_form" method = "post" action = "url_address">
<input type="image" src="address/name_of_image" alt="my form
description">
</form>
 
B

Beauregard T. Shagnasty

Peter said:
Well what has worked for me, especially with multiple forms on a page
is...

<form name = "name_of_form" method = "post" action = "url_address">
<input type="image" src="address/name_of_image" alt="my form
description">
</form>

How does the form get submitted?
 
B

Beauregard T. Shagnasty

Andy said:
Image <inputs> act the same as a submit <input>.

Heh, so it does. Though it certainly is not intuitive, unless maybe the
image is an image of text that says 'click me'. I think I will stick
with the more-normal and probably user-expected:
<input type="submit" title="Submit the Form Now" value=" Submit Form "
id="submit1" name="submit1">
 
M

mcnewsxp

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

like this?
http://www.thesitewizard.com/archive/textsubmit.shtml
 
J

Jukka K. Korpela

Beauregard said:
Heh, so it does. Though it certainly is not intuitive, unless maybe
the image is an image of text that says 'click me'. I think I will
stick with the more-normal and probably user-expected:
<input type="submit" title="Submit the Form Now" value=" Submit Form "
id="submit1" name="submit1">
 
J

Jukka K. Korpela

Ben said:
I dug out your page on CSS Caveats and there are only 8 on the list :)

I wonder which page you found; the page
http://www.cs.tut.fi/~jkorpela/css-caveats.html
has had 10 items for quite some time.
I was hoping you could help me out with some concrete
examples here of these styles you're thinking of that don't work on
BUTTON but do on SPAN.

Oh, I thought it was all too obvious that BUTTON elements have default
rendering quite different from that of SPAN as well as different across
browsers and underlying systems. If you set, say,

border-color: red

for a SPAN element, you expect this to have no effect by default (since SPAN
elements have no border by default). And if you have set a visible border
for a SPAN, then you expect that the only effect of the above declaration is
to set the color of the border. Not so with BUTTON, on a fairly typical
system (like Windows Vista) where buttons have borders with rounded corners
by default. The above declaration sets the border color to red but it also
turns it to a normal plain rectangular border.

So border-color: red works as per CSS recommendations for SPAN, but not for
BUTTON.
 
J

Jukka K. Korpela

Ben said:
OK, but that's rather a contrived example.

Doesn't "CSS" mean Contrived Style Sheets? (I know some people believe the
"C" comes from "Cascade", but so few people understand the CSS cascade, so
it must be a joke.) :)
Obviously if you wanted a
red border on a SPAN you'd set the other border properties too.

No, it would be quite natural to set, say,

* { border-color: red !important; }

(though probably with some other color value)
if you wanted to style a page so that all borders are of the same color. You
would override the color settings for all borders, without affecting the
presence, width, and type of borders.

But this would fail for BUTTON, in the sense that it would have a side
effect (which you cannot prevent), on many modern browsers.
Width works on P but not on SPAN because SPAN starts life as display:
inline, but this is not a caveat or anything special to do with P,
it's just how it works.

So has it anything to do with the issue that form fields have oddities in
styling? What you describe (somewhat vaguely - width works on SPAN too if
you set e.g. display: block on it) is part of CSS recommendations. But there
is a related caveat: on broken browsers in particularly broken mode, called
"Quirks Mode", width "works" on SPAN, even though it shouldn't.
 

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,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top