At 03:33 PM 4/29/01 -0700, you wrote:
>Dossy wrote:
>
> > 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.
>
>this is what i do too and it works pretty well
>once you get the hang of it...

This works nicely, and I haven't done this in a while, but I've since
learned about an ACS function bt_mergepiece,
http://www.google.com/search?hl=en&lr=&safe=off&q=bt_mergepiece&btnG=Google+
Search, that I think can be very helpful in this process.

Here's how it is documented:

>bt_mergepiece htmlpiece values
># HTMLPIECE is a form usually; VALUES is an ns_set
># NEW VERSION DONE BY BEN ADIDA ([EMAIL PROTECTED])

I believe it takes an ns_set similar to what ns_getform will give you and
then goes through an html form and populates the various fields it find
there making sure that checkboxes are checked, that text boxes and
textareas are filled out
correctly, etc.

Here's an example:

nscp 2> ns_set create form
t0
nscp 3> set s t0
t0
nscp 5> ns_set put t0 bob carol
0
nscp 6> ns_set put t0 ted alice
1
nscp 10> ns_set put t0 warren beatty
2
nscp 11> ns_set put t0 warren oates
3
nscp 12> ns_set put t0 warren piece
4
nscp 17> ns_set put t0 warren zevon
5
nscp 8> bt_mergepiece "<form><input type=text name=bob></form>" t0
<form><input type=text name=bob value="carol"></form>

nscp 9> bt_mergepiece "<form><input type=text name=bob><textarea
name=ted></textarea></form>" t0
<form><input type=text name=bob value="carol"><textarea
name=ted>alice</textarea></form>

nscp 13> bt_mergepiece "<form><input type=text name=bob><textarea
name=ted></textarea><input type=radio name=warren></form>" t0
<form><input type=text name=bob value="carol"><textarea
name=ted>alice</textarea><input type=radio name=warren></form>

nscp 15> bt_mergepiece "<form><input type=text name=bob><textarea
name=ted></textarea><input type=radio name=warren checked
value=oates></form>" t0
<form><input type=text name=bob value="carol"><textarea
name=ted>alice</textarea><input type=radio name=warren  value=oates></form>

nscp 18> bt_mergepiece "<form><input type=text name=bob><textarea
name=ted></textarea><input type=radio name=warren value=zevon></form>" t0
<form><input type=text name=bob value="carol"><textarea
name=ted>alice</textarea><input type=radio name=warren  value=zevon
checked></form>

=====================================================
Jerry Asher                       [EMAIL PROTECTED]
1678 Shattuck Avenue Suite 161    Tel: (510) 549-2980
Berkeley, CA 94709                Fax: (877) 311-8688

Reply via email to