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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:54:14+00:00 2026-06-11T10:54:14+00:00

I have a form (new poll form) in which I can add multiple items

  • 0

I have a form (new poll form) in which I can add multiple items (poll questions) to a collection using KnockoutJS. I want to know how can I force the user to enter a value into the question textbox before he can add a new row…

enter image description here

var App = function (pollData, pollQuestionData) {
             var self = this;
             self.poll = new Poll(pollData);
             self.questions = ko.observableArray([new PollQuestion(pollQuestionData)]); // Put one question in by defaul

             // Add new question function... here should go validation I guess???

             self.addQuestion = function () {
                 self.questions.push(new PollQuestion(pollQuestionData))
             };

             // Remove question function
             self.removeQuestion = function (question) {
                 self.questions.remove(question)
             };
         };

Here is my jsfiddle code (that by the way I couldn’t make it run…)

http://jsfiddle.net/AcE2V/3/

  • 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-11T10:54:15+00:00Added an answer on June 11, 2026 at 10:54 am

    Here is a fiddle that uses a computed observable to only show the New Question button when all questions have a value:

    http://jsfiddle.net/jearles/AcE2V/5/

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

Sidebar

Related Questions

I have a form which instances a new form that I've already created using
I have a form with wtform , I want to add a new form
I have a form with KeywordInline . When I add new object using the
I have a form to add new Appartments, and in this form I have
I have a list within Sharepoint, using a custom new form I have added
I am new to php. I want to have a form such as this:
I have a form for creation new order. One order can include several products.
I have form, which i dont want the user to see it. Dont ask
i generated doctrine-admin in backend. In frontend i have form for add new news.
I have a form which will open a new form when one button (form1button)

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.