Louis-David Mitterrand wrote: > Hello, > > How can I populate form elements, short of setting a '-default=>' value > on each of them. I tried in <%init>: > > for (values(%$defaults)) { > param($_, $defaults->{$_}); > } > > But it doesn't fill-in the form. Is there another way? > > Thanks,
What needs to happen, is for the value attribute of your input elements to be populate when you write out your HTML. It'd look something like this: <input type="text" name="thing" value="<% $defaults->{thing} %>" /> It would appear, from your comment about using '-default=>' and using param(...), that you're using another module to write your HTML for you, probably CGI. If this is the case, then it seems an odd thing to do with Mason, since Mason is basically a templating system designed to make it easy to mix HTML and perl. Either way, you need to do whatever it takes to populate that value attribute. With CGI.pm, you use the -value attribute. -Oli
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users