Arc Forumnew | comments | leaders | submitlogin
1 point by CatDancer 5972 days ago | link | parent

form expands into

  <form method=post action= ...
So the form is being submitted with a http POST method. With POST, the values are passed in the body of the request, instead of added to the URL using the ?a=1&b=2 syntax. When then POST comes into the Arc server, it pulls the arguments from the request body, ignoring the URL.

What you want is to include a hidden input value in your form:

    (gentag input type 'hidden name 'parm value 324342)
That way you'll get the parm value passed along in the form values.

Your use of "url" as a global variable is a bad idea if two users happened to request "test" at the same time. By the time "(do-it url)" is called, "url" might have been set to the other value by the other invocation of "test".



1 point by thaddeus 5972 days ago | link

I see, thanks.

and... I agree, I just start using globals to start then after I have it working I change 'em (bad habit).

    (defop test req
	   (let parm (arg req "parm")
	   (prn parm)
	   (br)	
           (if (is parm nil)
	       (do-it "test" url parm))   
               (do-it (string "test?parm=" parm) parm)    
    ))

    (def do-it (url parm)  
        (form url (gentag input type 'hidden name 'parm   value parm)
        (textarea "stuff" 10 50)
        (br)(submit))
    )
Works like a charm!

:)

T.

-----