From: Thomas 'PointedEars' Lahn on
Thomas 'PointedEars' Lahn wrote:

> bruce wrote:
>> I'm using a form because the actual image I want to display is on the
>> server. I plan to send a POST request, using AJAX, to get the image as
>> well as some other data. Thoughts on this approach?
>
> AISB, you will need one or two fallback solutions (but you can use
> basically the same markup for them). Neither XHR/AJAX nor client-side
> scripting may be supported. A first step would be to return `false' only
> if retrieving the image with scripting failed,
^^^^^^
I meant _succeeded_, sorry.

> so that the default action (the form submit) is not prevented then.

Strike through the "not", then.


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(a)news.demon.co.uk> (2004)
From: bruce on
On May 29, 6:54 am, Thomas 'PointedEars' Lahn <PointedE...(a)web.de>
wrote:


> The proper way to do this is of course
>
>   <form action="" method="post"
>         onsubmit="getImage('imgSpot'); return false;">
>     <img name="imgSpot" src="" height="200" width="200"
>          alt="alternative text">
>     <br>
>     <input type="submit" name="submit_button" value="Submit">
>   </form>
>

This did exactly what I wanted to do. I did have to add "id" to the
<img tag so that "getElementById" would work.

Thanks...

Bruce
From: Thomas 'PointedEars' Lahn on
bruce wrote:

> Thomas 'PointedEars' Lahn wrote:
>> The proper way to do this is of course
>>
>> <form action="" method="post"
>> onsubmit="getImage('imgSpot'); return false;">

onsubmit="return getImage('imgSpot');">

whereas getImage() would return `false' if retrieving the image with
scripting would be (supposed to be) successful.

>> <img name="imgSpot" src="" height="200" width="200"
>> alt="alternative text">
>> <br>
>> <input type="submit" name="submit_button" value="Submit">
>> </form>
>
> This did exactly what I wanted to do. I did have to add "id" to the
> <img tag so that "getElementById" would work.

AISB, you can lose the `id' attribute if you use document.images[...]
instead of document.getElementById(...).

> Thanks...

You're welcome.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16