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 6731705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:33:39+00:00 2026-05-26T10:33:39+00:00

I have the following form: <form class=lift:form.ajax> <input type=hidden class=lift:StreamIn id=path value=PATH /> <input

  • 0

I have the following form:

<form class="lift:form.ajax">
    <input type="hidden" class="lift:StreamIn" id="path" value="PATH" />
    <input type="submit" value="" />
</form>

Which feeds into:

object StreamIn {

    def render = SHtml.onSubmit(path => {

        StreamServer ! path

    })

}

case class StreamItem(user: String, path: String, level: String, room: String)

object StreamServer extends LiftActor with ListenerManager {

    private var streams: List[StreamItem] = Nil

    def createUpdate = streams

    override def lowPriority = {

        case stream: String if stream.length > 0 =>

            streams :+= StreamItem("James", stream, "_1", "demo-room");
            updateListeners()

    }

}

What I’m looking for is a way of passing multiple values to the StreamServer with more than one input.

So instead of the static string values “James”, “_1” and “demo-room” they will be passed from the form.

Thanks in advance for any help, much appreciated 🙂

  • 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-05-26T10:33:39+00:00Added an answer on May 26, 2026 at 10:33 am

    Is it ok to have several input fields on your ajax form?
    If so, how about:

    <form class="lift:form.ajax">
      <div class="lift:StreamIn">
        <input type="text" name="path" />
        <input type="text" name="user" />
        <input type="text" name="level" />
        <input type="text" name="room" />
        <input type="hidden" name="hidden" />
      </div>
    </form>
    

    Updated:

    object StreamIn {
      case class StreamItem(user: String, path: String, level: String, room: String)
      def render = {
        var path= ""
        var user= ""
        var level= ""
        var room= ""
          def process(): JsCmd= {
            val message= StreamItem(user, path, level, room)
            StreamServer ! message
          }
    
        "name=path" #> SHtml.onSubmit(path= _ ) &
        "name=user" #> SHtml.onSubmit(user= _ ) &
        "name=level" #> SHtml.onSubmit(level= _ ) &
        "name=room" #> SHtml.onSubmit(room= _) &
        "name=hidden" #>  SHtml.hidden(process)
    
      }
    }
    

    And change the lowPriority for:

    override def lowPriority = {
      case StreamItem(userIn, pathIn, levelIn, roomIn) => {
        streams :+= StreamItem(userIn, pathIn, levelIn, roomIn);
        updateListeners()
      }
    
    }
    

    I missed a few } but I hope you get the idea, you may be able to omit some fields like the room and level, if you have them available, you may be able to access them by using a RequestVar.

    You can do more reading on ajax forms on the Simply Lift Book

    Hope it helps

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

Sidebar

Related Questions

I have the following form: <form class=lift:form.ajax> <div class=lift:StreamInput> <input type=hidden name=path value=test />
I have the following form: <form class=lift:form.ajax> <div class=lift:StreamInput> <input type=hidden name=user value=USER />
I have the following form: <input name=q value= class=qa-search-field> <input type=submit value=Search class=qa-search-button> I
I have the following AJAX form on my page: <form class=lift:form.ajax> <div class=lift:StreamInput> <input
I'm looking at some Java classes that have the following form: public abstract class
I have the following form code: # forms.py class SomeForm(forms.Form): hello = forms.CharField(max_length=40) world
I have the following form, which I have reduced as much as I can,
I have the following form for photo_album which uses the nested forms feature of
I have the following rails form (which works) but I want to remove the
I have the following form: class ModuleItemForm2(forms.ModelForm): class Meta: model = Module_item fields =

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.