Sorry if this is a newb question, my experience is more with ASP and ASP.NET.  
I have searched for an answer on this but I haven't found much info. If this is 
the wrong list for this question then my apologies.
 
I realize there may not be one right answer but I would like to hear from other 
people if there is a preferred method.
 
The issue is when I post a page that has a form and fields to be filled out. 
Currently I am replicating the method I used with ASP,  a submited page is 
posted back to it self, with Mason I look to see if submit is true, and if so 
then I move into the block to process the form. If there is a data validation 
error in processing the form (ie blank field, improper format etc) then I end 
up showing the same page with error messages around the offending fields.  But 
if everything checked out ok then I call my next page which in this case is a 
success page.
 
Really looking for guidance and best practice on how to handle posts with Mason.
 
Very stripped down example:
 
<html>
<body>
<form method="POST">
<input type="text" name="Email_Address" size="25" maxlength="30" value="<% 
$Email_Address %>">
<input type="password" name="Password" size="25" maxlength="30">
<input type="password" name="Confirm_Password" size="25" maxlength="30">
<input type="submit" name="Submit" value="Create Account">
</form>
</body>
</html>
 
<%init>
  
    if($Submit)    {        if($Email_Address eq '')        {            
$Message = "You must enter your Email Address";            goto END;        }   
   
        if($Password ne $Confirm_Password)        {            $Message = "The 
Passwords do not match. Please enter them again";            $Password = "";    
        $Confirm_Password = "";
            goto END;        }        
        my $Success = AccountManagement::Create_Account($Email_Address, 
$Password, 1);           }
 
    END:
</%init>
 
 
_________________________________________________________________
When your life is on the go—take your life with you.
http://clk.atdmt.com/MRT/go/115298558/direct/01/
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to