diff options
Diffstat (limited to 'demos/blog-tutorial/protected/pages/Day1/CreateContact.page')
-rw-r--r-- | demos/blog-tutorial/protected/pages/Day1/CreateContact.page | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page index 4daf43e3..28ad4b21 100644 --- a/demos/blog-tutorial/protected/pages/Day1/CreateContact.page +++ b/demos/blog-tutorial/protected/pages/Day1/CreateContact.page @@ -47,37 +47,34 @@ We use template to organize the presentational layout of the feedback form. In t <com:TForm>
-<h1>Contact</h1>
-<p>Please fill out the following form to let me know your feedback on my blog. Thanks!</p>
-
<span>Your Name:</span>
<com:TRequiredFieldValidator ControlToValidate="Name"
- ErrorMessage="Please provide your name."
- Display="Dynamic" />
+ ErrorMessage="Please provide your name."
+ Display="Dynamic" />
<br/>
<com:TTextBox ID="Name" />
<br/>
<span>Your Email:</span>
<com:TRequiredFieldValidator ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
- Display="Dynamic" />
+ ErrorMessage="Please provide your email address."
+ Display="Dynamic" />
<com:TEmailAddressValidator ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
- Display="Dynamic" />
+ ErrorMessage="You entered an invalid email address."
+ Display="Dynamic" />
<br/>
<com:TTextBox ID="Email" />
<br/>
<span>Feedback:</span>
<com:TRequiredFieldValidator ControlToValidate="Feedback"
- ErrorMessage="Please provide your feedback."
- Display="Dynamic" />
+ ErrorMessage="Please provide your feedback."
+ Display="Dynamic" />
<br/>
<com:TTextBox ID="Feedback"
- TextMode="MultiLine"
- Rows="10"
- Columns="40" />
+ TextMode="MultiLine"
+ Rows="10"
+ Columns="40" />
<br/>
<com:TButton Text="Submit" OnClick="submitButtonClicked" />
@@ -103,13 +100,13 @@ Besides <tt>TTextBox</tt> controls, the template also uses many validator contro <com:TTextHighlighter CssClass="source" Language="prado">
<span>Your Email:</span>
<com:TRequiredFieldValidator
- ControlToValidate="Email"
- ErrorMessage="Please provide your email address."
- Display="Dynamic" />
+ ControlToValidate="Email"
+ ErrorMessage="Please provide your email address."
+ Display="Dynamic" />
<com:TEmailAddressValidator
- ControlToValidate="Email"
- ErrorMessage="You entered an invalid email address."
- Display="Dynamic" />
+ ControlToValidate="Email"
+ ErrorMessage="You entered an invalid email address."
+ Display="Dynamic" />
<br/>
<com:TTextBox ID="Email" />
<br/>
@@ -152,29 +149,29 @@ We thus write down the page class as follows: <?php
class Contact extends TPage
{
- /**
- * Event handler for the OnClick event of the submit button.
- * @param TButton the button triggering the event
- * @param TEventParameter event parameter (null here)
- */
- public function submitButtonClicked($sender, $param)
- {
- if ($this->IsValid) // check if input validation is successful
- {
- // obtain the user name, email, feedback from the textboxes
- $name = $this->Name->Text;
- $email = $this->Email->Text;
- $feedback = $this->Feedback->Text;
-
- // send an email to administrator with the above information
- $this->mailFeedback($name, $email, $feedback);
- }
- }
-
- protected function mailFeedback($name, $email, $feedback)
- {
- // implementation of sending the feedback email
- }
+ /**
+ * Event handler for the OnClick event of the submit button.
+ * @param TButton the button triggering the event
+ * @param TEventParameter event parameter (null here)
+ */
+ public function submitButtonClicked($sender, $param)
+ {
+ if ($this->IsValid) // check if input validation is successful
+ {
+ // obtain the user name, email, feedback from the textboxes
+ $name = $this->Name->Text;
+ $email = $this->Email->Text;
+ $feedback = $this->Feedback->Text;
+
+ // send an email to administrator with the above information
+ $this->mailFeedback($name, $email, $feedback);
+ }
+ }
+
+ protected function mailFeedback($name, $email, $feedback)
+ {
+ // implementation of sending the feedback email
+ }
}
?>
</com:TTextHighlighter>
|