On 2001.04.29, Steve Manning <[EMAIL PROTECTED]> wrote:
> The problem here is that the ns_returnredirect tries to use a GET method to
> return the value of the notes textarea which isn't very reliable. I would
> like to replace the ns_returnredirect in the tcl proc with a post to the
> adp page. If anyone has a different approach to this problem I would
> appreciate the input.

You can't issue a URL redirect and instruct the browser to access
the URL using the POST method.

You're better off having your form ADP page submit back to itself,
and in the form ADP page, check for a hidden form field (like "action")
and make sure it equals something sensible (like "submit").  I'd
suggest making the submit button name="action" value="submit" but
if you need to support MS IE browsers, you're not guaranteed that
the submit button's name/value will be submitted with the form (if
the user hits enter in a text-input field, for instance).

If your ADP page sees action=submit, it should perform the validation.
If validation fails, re-display the form with fields pre-populated
and the error message displayed.  If validation succeeds, do whatever
you want with the data (save to database, etc.) then URL redirect
the user to the next page they should be seeing.

That's what I do, in any case, and it works for me.


> The crass options are to display the error with a message telling the user
> to hit the Back button or to show the form page with the error but present
> a new blank form. Another option is to store the values on the server
> somewhere and have the adp page retreive them (abit like a jsp session).

Sessions are also a good way of solving this problem and keeps your
pages much easier to develop.  Of course, I don't know where Steve
Arentz's (I believe I got the name right) nssession module is in
terms of completeness, and I haven't started working on my version of
it, yet.


Best of luck, HTH, HAND,

- Dossy

--
Dossy Shiobara                       mail: [EMAIL PROTECTED]
Panoptic Computer Network             web: http://www.panoptic.com/

Reply via email to