Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5

Objective

Introduce actions and techniques for using KRL on the Web. 

Setup

  • Create a new ruleset to use for the following exercises. 

Exercises

  1. Write a rule called show_form that inserts text paragraph (make up the text) in the <div/> element with the ID of main on ktest.heroku.com
  2. Modify the show_form rule from (1) to place a simple Web form that has fields for a first name, a last name, and a submit button. Use the watch() action to watch it for activity. 
  3. Write a rule that selects on submit and takes the first and last name from the form in (3) and stores them in entity variables.
  4. Modify the ruleset so that if a first and last name have been stored, they are displayed in the page (in a paragraph under the form) and if they are not, the form is displayed. 
  5. Add a clear rule that clears the names if the query string clear=1 is added to the URL. 
  • No labels