Thanks, that's even less code than the 'amazing' jquery answer ;)
rgds,
Kristian.
Oliver Jeeves wrote:
Kristian Nilssen wrote:
Is there any way I can get the text out of a textarea into a mason
variable? I want to save the textarea contents to a file on the server
when user presses submit. I can access the DOM in javascript, can I get
access to the textarea in mason?
Yes, it's just a request argument like any other form element.
If you had the HTML:
<form action="" method="post">
<label>
Enter Text:
<textarea name="mytext" rows="5" cols="20">here</textarea>
</label>
<input type="submit" name="mysubmit" value="Do Stuff!" />
</form>
And the mason code:
my $textarea_contents = $m->request_args->{mytext};
you can then do anything you like with $textarea_contents, including
writing it to a file, if you desire.
-Oli
-------------------------------------------------------------------------
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