| Author |
Message |
< Yaws mailing list ~ newbie: using postvar to detect hidden variables |
| Guest |
Posted: Sun Sep 03, 2006 9:38 am |
|
|
|
Guest
|
Hi,
Just messing about with Yaws. What's wrong with this code? It's
supposed to ask for your name first time around then print it after it
is submitted all on the same page but it doesn't.
<html>
<head>
</head>
<body>
<erl>
out(A) ->
case postvar(A, "submitted") of
undefined ->
{ehtml,
{form, [{action, "./hello.yaws"}],
{p, [],
["Enter your name",
{input, [{name, "name"}, {type, "text"}]},
{input, [{type, "submit"}]},
{input, [{name, "submitted"},
{type, "hidden"}, {value, "1"}]}]}}};
N ->
{ehtml,
{p, [], ["Your name is ", N]}}
end.
</erl>
</body>
</html>
Cheers,
Chris
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Sun Sep 03, 2006 9:54 am |
|
|
|
Guest
|
|
| Back to top |
|
| Guest |
Posted: Mon Sep 04, 2006 8:13 pm |
|
|
|
Guest
|
Chris Campbell wrote:
> case postvar(A, "submitted") of
> undefined ->
> {ehtml,
> {form, [{action, "./hello.yaws"}],
> {p, [],
>
Hi Chris,
HTML forms default to method="get" rather than "post", and you're using
postvar (not getvar, which I think also exists) to get it. I've
wrappered postvar and getvar in my apps, I trip over this one as
sometimes I want both types of form (form launched with get, but does
internal post).
hth,
Bruce
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Tue Sep 05, 2006 3:35 pm |
|
|
|
Guest
|
On 04/09/06, Bruce Fitzsimons <Bruce@fitzsimons.org> wrote:
> Hi Chris,
>
> HTML forms default to method="get" rather than "post", and you're using
> postvar (not getvar, which I think also exists) to get it. I've
> wrappered postvar and getvar in my apps, I trip over this one as
> sometimes I want both types of form (form launched with get, but does
> internal post).
Yeah, I've forgotten all this stuff. I only did a little web
programming a few years ago and only a very little. That's my excuse
anyway.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|