Hi,
I thought I would send my problem on this list and see if someone can help me out.
I am working on Address Book on the Web (webmail.aol.com), and it has a UI where you can select addresses to send mail to.
Its a paged UI in the sense that addresses are grouped into alpha buckets, ABC, DEF etc. So if you click on ABC bucket, you see addresses whose last names begin with A or B or C. User can select addresses on one page and can then go to another bucket and select addresses there, then can go back to previous
page, select/deselect address, or go to other page etc. What we need to do is to save all user's selections till he clicks on send mail button.

ADP page has an HTML form with POST and hidden fields. I use a hidden fld to pass list of selected records to other buckets. I am using the following code in the page for links to alphabets
(main.adp) ns_adp_puts "<ahref=\"\" class="moz-txt-link-rfc2396E" href="">"_javascript_:saveSelectedAndSubmitForm();return false;\">ABC</a>&nbsp\;"
The _javascript_ method saveSelectedAndSubmitForm() iterates over selected checkboxes and adds it to the hidden variable, and finally calls document.submit()

In the adp file, I try to get the value of hidden form field and here is what happens. When I use GET, I am able to see that hidden form fld, however, when I use POST, it seems no form data is submitted to the server.
Here is the sample code

(main.adp)
<%
set theformdata [ns_getform]
set rid ""
if {$theformdata != ""} {
         set rididx [ns_set find $theformdata rid]
         if {$rididx != -1} {
                 set rid [ns_set value $theformdata $rididx]
         }
}
%>
<form>
<input type="hidden" name="rid" value="<%=$rid%>">
</form>

$theformdata is null when POST is used.

Is there a difference between the way data is posted with GET and POST ? I think not, but then how can one explain such behavior. I think I am using the correct JS code. Heres a snapshot.
function saveSelected..() {
    document.forms.theForm.rid.value = prevList; // rid is the hidden form fld. prevList is the value assigned to this fld
    document.forms.theForm.action="";
    document.forms.theForm.submit();
}

--
Software Engineer
America Online Inc
Mountain View,CA


-- AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.



Reply via email to