Topics Map > Communication & Collaboration > Email & Calendaring
Topics Map > Communication & Collaboration > Website Services

How do I reformat input in FormMail?

This article details how to reformat input fields in FormMail.

This example shows the use of the <format> tag to reformat some input fields using FormMail. Try a demo.


<head><title>Just testing</title></head>
<form method="post" action="">

<h1>Example of FormMail 3.0</h1>
This example shows the use of <em>Format</em> to reformat some
input fields, and possible interaction with <em>validation</em>
of these fields.  Note the <em>debug</em> flag is turned on,
so you can see the results of the reformatting.
Try different values in the input, and see how (and if) it gets reformatted.

Email: <input type="text" name="email"><br>
Phone: <input type="text" name="phone"><br>
Digits: <input type="text" name="digits"><br>
<textarea rows=3 cols=20 name="newline">

<input type="submit" value="Submit the form">

Configuration file

<!DOCTYPE form SYSTEM 'FormMail-3.0.dtd'>
<form name="example7" debug>

 <!-- List all the fields needing potential reformatting -->
<format name="email" vtype="email">
<format name="phone" vtype="phone">
<format name="digits" vtype="digits">
<format name="newline" vtype="newline">

 <!-- List all the fields needing server-side validation -->

<validate name="email" public="The email field"  vtype="email" > 
<validate name="phone" public="The phone field"  vtype="phone10" > 
<validate name="digits" public="The digits field"  vtype="digits" > 

 <!-- This prevents any mail being sent for this example -->

<mail name="mail2" nomail>

 <!-- Here's the html response when all input is valid 
      Note that the full html page is generated, including
      the <html>...</html> tags 

<response name="r0" >
<h1> Thank You for Submitting your Info</h1>
The email field became: $email<br>
The phone field became: $phone<br>
The digits field became: $digits<br>
The textarea became: <code>$newline</code><br>


Keywords:mail, code, script, configure, form   Doc ID:91748
Owner:Radhika R.Group:University of Illinois Chicago Technology Solutions
Created:2019-05-15 07:58 CSTUpdated:2019-06-11 12:28 CST
Sites:University of Illinois Chicago Technology Solutions
Feedback:  0   0