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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:37:32+00:00 2026-06-01T12:37:32+00:00

I am using MVC3, EF Model first on my project. I have a view

  • 0

I am using MVC3, EF Model first on my project.

I have a view with 4 tables and then I have a CustomPickedTable, whenever a user click on a row inside those 4 tables that row moves to CustomPickedTable Table this is the code for it:

<script type="text/javascript">
        $(function () {
            $('.questionsForSubjectType tbody tr').click(function () {
                var origin = $(this).closest('table').attr('id');
                $(this)
        .appendTo('#CustomPickedTable tbody')
        .click({ origin: origin }, function (evt) {
            $(this).appendTo('#' + evt.data.origin);
                });
            });
        });
</script>

What I am looking for is some kind of validation that when a user clicks on the submit button there should be a rule that make sures that atleast one row in each of those 4 tables must be moved to CustomPickedTable if not it should not post the form but give the user an errormessage.

This is one of my 4 tables, these get generated by a foreach loop with razor in MVC

    <div class="questionsForSubjectType" id="questionsForSubjectType_1">              
              <table class="box-style2" id="RandomID_c5b9bc7a-2a51-4fe5-bd3a-75b4b3934ade">
                <thead>
                  <tr>
                    <th>
                    Kompetens
                    </th>
                  </tr>
                </thead>
                  <tbody>
                   <tr>
                     <td data-question-id="16">Har konsulten F&#246;rm&#229;ga att l&#228;ra sig nytt?</td>   
                   </tr>
                  </tbody>
                  <tbody>
                   <tr>
                     <td data-question-id="17">Har konsulten r&#228;tt kompetens?</td>   
                   </tr>
                  </tbody>
               </table>
    </div>

My custom table:

<table id="CustomPickedTable" class="box-style2">
<thead><tr><th>Choosen Questions</th></tr></thead>
<tbody>
</tbody>
</table>

Thanks in advance!

  • 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-01T12:37:34+00:00Added an answer on June 1, 2026 at 12:37 pm

    There might be a better way.

    But i would add a data-attribute or some class to each of the TD’s you can move, and on submit check for each required value.

    Created an example here: http://jsfiddle.net/y35Qf/1/

    Basicly i added an attribute called data-row, and each table has its own value, on submit i require each of these values to be in the CustomPickedTable – if not i alert that something is missing – else alert success.

    You could easily add so you alert which rows are misssing or any other validation you would want.

    Is this what you wanted?

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

Sidebar

Related Questions

I am using MVC3, EF Model first on my project. I have a view
I am using MVC3 on my project. I have a view with tables and
I am using MVC3, EF Model first. I have a form with two DropDownList
I have an MVC3 project I created using the Code First paradigm and it
I have developed a project using MVC3 and Code first Entity Framework 4.0 as
I am using MVC3 with Entity Framework Code First. I have the following model.
I'm using MVC3 and I have a model like this: public class Foo {
In ASP.NET MVC3, when a view model is passed into a view using return
I just created a new project in MVC3 using EF4 code first deployed on
I'm developing MVC3 project and have this situation. only at runtime. I'm using the

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.