HTML enhancement concept...

I have "discovered" something very interesting in my wonderings through HTML 
and various permeations  of forms.


(Yes, this is basic stuff!)

You can have multiple submit buttons, like so...

    <input type="submit" name="options" value="Yes">
    <input type="submit" name="options" value="No">
    <input type="submit" name="options" value="Maybe">

And if you hit the second button, the browser will return...
    options=No

This makes it real nice to have an semi-smart cgi to deal with the same data
slightly different depending on which button the user selected.

You can also use an image for a submit button.

So, based upon the above example, ands the fact you can have images as submit
buttons, I can theorize the following...

    <input type="image" scr="/images/yes.gif"    name="options"  value="yes">
    <input type="image" scr="/images/no.gif"     name="options"  value="no">
    <input type="image" scr="/images/maybe.gif"  name="options"  
value="maybe">

And if you hit the second button (just like the previous), the browser will 
return...
    options=No

But this is not the case. The browser returns...
    options.x=25&options.y=10

This is the coordinates where the mouse clicked on the graphic.

This information is fine if I have an image map as a multiple submit buttons, 
or a single image supporting a single submit button.

But what if I want multiple images to represent multiple submit buttons?

I could simply modify my submit code as such...

    <input type="image" scr="/images/yes.gif"    name="opt-yes"    
value="yes">
    <input type="image" scr="/images/no.gif"     name="opt-no"     value="no">
    <input type="image" scr="/images/maybe.gif"  name="opt-maybe"  
value="maybe">

With this change in the NAME, I would get the following results...
     opt-no.x=25&opt-no.y=10

With this output, I would have to modify my cgi to parse the return string and 
toss out anything after period.

Somewhat a minor task, but annoying on the whole.

The reason for this letter is not to simply rant, or to teach you about submit 
buttons and images, but to propose a simple solution.

Since the normal button returns the NAME and VALUE in a readable format, and 
the image button returns coordinates in a nice parsing fashion, I would like 
to propose that the image submit button return both the data types in the 
following manner...

   option=25&option=10&option=no

This gives us both sides of the coin so developers can use which ever method 
they need to use for whatever purpose they need it for.

I hope this will spark some discussion on this subject.

Walter Torres

PS: Forgive me if this is not the proper form for this type of thing.
    I seems like the best place I could find to talk about this issue.

Received on Friday, 27 September 1996 11:19:40 UTC