Kbase 17179: Example: Logon Screen in WebSpeed 2.x (with Validation)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/20/2004 |
|
Status: Unverified
GOAL:
WebSpeed 2.x Example of Logon Screen using validation
FACT(s) (Environment):
WebSpeed 2.x
FIX:
The log-on screen (logon.htm) is included below. It consists of a form with an action of chkname.w.
Chkname.w is a CGI wrapper procedure that checks the input from logon.htm. Based on the output of validation that is performed, it either runs another web object or returns to the logon screen for a re-entry of data.
Both logon.htm and chkname.w use the output-messages() and queue-messages() functions to display the validation messages.
/* logon.htm */
<html>
<head>
<title>Logon Screen</title>
</head>
<body>
<h1>Logon Screen</h1>
<hr>
<form action="chkname.w" method="POST">
<p>Enter your user-name in the space provided below.</p>
<blockquote>
<p><input type="text" size="30" maxlength="30"
name="name"> <br>
</p>
</blockquote>
<p><input type="submit" name="submit" value="Submit Form">
<input type="reset" name="reset" value="Reset Form"> </p>
</form>
<!--WSS output-messages("group", "validate", "Validation Errors"). -->
</body>
</html>
For chkname.w - create a CGI wrapper procedure and add the following
code to the process-web-request procedure:
find first customer where customer.name = get-value("name")
no-lock no-error.
if available(customer) then
run one.r. /* Run the next web object if it passes validation */
else do:
run logon.r.
queue-message("validate", html-encode("Invalid User Name entered")).
end.