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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:59:30+00:00 2026-06-11T20:59:30+00:00

I have a form created with CActiveForm and the HTML output is something like

  • 0

I have a form created with CActiveForm and the HTML output is something like this

...
    <tr>
        <td><input class="span9" placeholder="Type in the seminar title" name="CvSeminar[0][title]" id="CvSeminar_0_title" maxlength="255" value="Some Value" type="text">        <span class="help-inline error" id="CvSeminar_0_title_em_" style="display: none"></span>    </td>
        <td><input class="span1" name="CvSeminar[0][yearIssued]" id="CvSeminar_0_yearIssued" maxlength="4" value="2009" type="text">        <span class="help-inline error" id="CvSeminar_0_yearIssued_em_" style="display: none"></span>    </td>
        <td><a href="#" class="removeSeminarRow"><i style="margin-top: 10px" class="icon-remove"></i></a></td>
    </tr>
    <tr>
        <td><input class="span9" placeholder="Type in the seminar title" name="CvSeminar[1][title]" id="CvSeminar_1_title" maxlength="255" value="Some Value" type="text">        <span class="help-inline error" id="CvSeminar_1_title_em_" style="display: none"></span>    </td>
        <td><input class="span1" name="CvSeminar[1][yearIssued]" id="CvSeminar_1_yearIssued" maxlength="4" value="2006" type="text">        <span class="help-inline error" id="CvSeminar_1_yearIssued_em_" style="display: none"></span>    </td>
        <td><a href="#" class="removeSeminarRow"><i style="margin-top: 10px" class="icon-remove"></i></a></td>
    </tr>
...

As you can see i create an area where each row cantains two fields. I have also created a button where a user can add a new row. The html output when the user hits the button is:

<tr>
   <td><input class="span9" placeholder="Type in the seminar title" name="CvSeminar[1000][title]" id="CvSeminar_1000_title" maxlength="255" type="text"><span class="help-inline error" id="CvSeminar_1000_title_em_" style="display: none"></span></td>
   <td><input class="span1" name="CvSeminar[1000][yearIssued]" id="CvSeminar_1000_yearIssued" maxlength="4" type="text"><span class="help-inline error" id="CvSeminar_1000_yearIssued_em_" style="display: none"></span></td>
   <td><a href="#" class="removeSeminarRow"><i style="margin-top: 10px" class="icon-remove"></i></a></td>
</tr>

My problem starts when i create a new row and leave it empty. The Ajax validation on server side works fine. Yii responds with json that the new field has errors.

{"CvSeminar_1000_title":["Title cannot be empty."],"CvSeminar_1000_yearIssued":["Year cannot be empty"]}

The problem is on client side. Since yiiactiveform does know nothing about the new added row, how can I update yiiactiveform to include the newly added fields ?

Thanks

  • 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-11T20:59:31+00:00Added an answer on June 11, 2026 at 8:59 pm

    When you add the new row just update the form settings with the new attribute to validate.

    var settings = $(myform).data('settings');
    settings.attributes.push({
       ...Validation settings here
    });
    $(myform).data('settings', settings);
    

    Have a look at the javascript Yii generates so you know what to use.

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

Sidebar

Related Questions

I have created a form <form name=form1 method=post> <textarea rows=5 cols=20 name=ta1></textarea> <input type=submit
I have a form ive created as follows <label>Search:</label> <form name=findrecipe action=#> <input type=radio
When you have an ASP.Net MVC form created by Html.BeginForm(), how do fields inside
I have a form created in mysite/new_player.html. It accepts 3 fields, user_name, real_name, and
I have a form created where user will select yes if they have something.
I have created a form with an input field and a button in symfony2.
I have a form model created as following: from plone.app.directives import Form class IFormSchema(form.Schema):
I have created form inside a template file. Form code looks like: <div id=form
i have created a form with zend framework and this form have some elements
I have an ajax form created with the html helper: @using (Ajax.BeginForm(...)) The problem

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.