O'Reilly logo

Lift Application Development Cookbook by Gilberto T. Garcia Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating forms

In this recipe, we'll learn the basic technique for creating forms. Lift offers a neat and easy mechanism to help the creation of forms, called LiftScreen.

Getting ready

We'll modify the code that we used in the recipe, Sending e-mails using Gmail's SMTP server, in Chapter 1, Getting Started with Lift Basics.

You can duplicate and rename the code that we created before to keep the original example, or you can modify it during this recipe.

How to do it...

  1. Replace the p tag and its contents in the index.html file with the following code:
    <div class="lift:SinglePageForm"></div>
  2. Create a file called SinglePageForm.scala in the snippet package; it should contain the following code:
    package code.snippet import net.liftweb.http._ import code.lib.SendEmail ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required