TAILIEUCHUNG - Embedding Perl in HTML with Mason Chapter 8: Building a Mason Site-P4

Tham khảo tài liệu 'embedding perl in html with mason chapter 8: building a mason site-p4', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 8 Building a Mason Site-P4 . users This form is used for both creating new users and editing existing ones. To prepopulate the form fields it first looks at the ARGS hash. If there are values for these fields here it assumes that these have priority because the only way for ARGS to have such values is if the form was submitted but then rejected for a data validation error in which case the browser is redirected back to the submitting page. When that happens we want to show the user the rejected values that were just entered into the form. If there is nothing in ARGS then we look at the user object for these values. Unless the user for whom this page is being generated is an admin user we don t bother showing the checkbox that allows them to turn on the admin flag for a user since that checkbox is respected only when a site administrator submits the form. The submit_to variable is used to set the form s action attribute. This allows us to use this form for both creating new users and editing existing ones. The return_to value is simply passed through the form to the component that handles the form submission which will use it to determine where to send the browser if the form submission is successful. foreach my err @errors tr td colspan 2 span class error err h td tr form action lib path submit_to method POST input type hidden name return_to value return_to if user- user_id input type hidden name user_id value user- user_id tr td Username td td input type text name username value form_vals username h size 20 maxlength 30 td tr tr td Password td td input type password name password value form_vals password h size 20 maxlength 100 td tr tr td Confirm password td td input type password name password2 value form_vals password2 h size 20 maxlength 100 td tr tr td Real name td td input type text name real_name value form_vals real_name size 20 maxlength 75 td tr

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.