Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8719141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:43:13+00:00 2026-06-13T06:43:13+00:00

Hello fellow programmers, as you might know from my previous questions I’m an absolute

  • 0

Hello fellow programmers,
as you might know from my previous questions I’m an absolute newbie in the Scala/Lift world, therefore I might ask some trivial questions, sorry for that 🙂

I’d love to make a custom login form to authenticate a user (the user is not authenticated via a database but instead via an API call through Google Protocol Buffer), so all I need to do is grab the inputs and send them to the API.

So far, I came up with my login.html page:

<div id="loginContainer" class="loginMainContainer centerContainer">
      <div class="loginInputWrapper">
        <input type="text" name="loginName" id="loginName" class="txtLogin" />
      </div>
      <div class="loginInputWrapper">
        <input type="password" name="loginPassword" id="loginPassword" class="pwLogin" />
      </div>
      <div class="buttonWrapper loginButtonWrapper">
        <button type="submit" class="hiddenButton qsbfont">Login</button>
      </div>
    </div>

and I want to grap the loginName and loginPassword field values. Which is the (best) way to achieve this?

I tried to get it with this class and add it to the snippet package, but I can’t figure out how to wire these two together. Here’s my snippet:

object MyAuthentication {
  def authentication(name: String, password: String) = {

    def validate(user: String, password: String): Boolean = {
      if(user == "tac" && password == "tac") true else false
    }

    def createUser(loggedIn: Boolean): Boolean = {
      if (loggedIn) {
        val user = new MyUser
        user.setName(name)
        user.setUID(1111)
        user.setLoginState(loggedIn)
        user.setLanguage("en_EN")
      }
      loggedIn
    }

    if (createUser(validate(name, password)))
      <span>loggedIn</span>
    else
      <span>failure!</span>

  }

  def render = SHtml.onSubmitList(credentials => {
    authentication(credentials(0), credentials(1))
  })

}

So, is it possible like that? How can I wire these two things together?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:43:14+00:00Added an answer on June 13, 2026 at 6:43 am

    Not a complete answer, but hopefully a pointer for where to start:

    Check out this Ajax Form demo. The related scala source is here and the template source is here.

    This seems to be similar to what you’re trying to do. The way they tie everything up is to wrap the fields of what-would-be-the-form in a <lift:snippet type="AjaxForm:show" form="post">. Then on the server side, the show method takes the template xml (they use Group as the argument type, but I’m pretty sure you can interchange that for NodeSeq) and bind the fields to Ajax-enabled fields.

    Note the import SHtml._ in the demo’s source… frankly I dislike the demos for doing this as it makes it hard to understand where methods are coming from, for newcomers to Lift. Methods like untrustedSelect, select, submit, and ajaxCall are coming from that import.

    As a last note, I find Lift’s Google Groups page to be more helpful than SO for Lift-related questions. I’m no Lift guru, but the people there are. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello Again my fellow programmers out there, I'm designing and programming from scratch a
Hello fellow programmers! Recently, I started learning Git, and pretty quickly discovered the amazing
Hello fellow programmers, First, sorry for the long post. My question is rather simple,
Hello fellow programmers, I'm using nice URLs the first time and I can't quite
Hello fellow programmers. I have a SQL Server 2005 query that is taking a
hello fellow programmers, I followed a tutorial at http://www.androidsnippets.com/encrypt-decrypt-between-android-and-php to send a String encrypted
Hello fellow developers, I am a total newbie in Android development and I am
Hello fellow developers! I am trying to get the build error codes from a
Hello fellow programmers, I have made a function that looks up the database if
Hello fellow programmers, got a few problem here. I am adding a user control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.