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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:39:39+00:00 2026-06-10T00:39:39+00:00

I have the following form: <form > <input value=333 id=modal_Order_1 class=update-grid> <input value=xxx id=modal_Link_1

  • 0

I have the following form:

<form >
   <input value="333" id="modal_Order_1" class="update-grid">
   <input value="xxx" id="modal_Link_1" class="update-grid">
   <input value="yyy" id="modal_Title_1" class="update-grid">
</form>

and a table:

<tr id="row_1" >
<td><input id="input_Order_1"></td>
<td><input value="x" id="input_Link_1"></td>
<td><input value="y" id="input_Title_1"></td>
</tr>

I have the following code that one by one takes values from the form and updates the table row. Note that my code knows the row number as it is in the rowNum variable:

var rowNum = oSubmit.rownum;
var order = $form.find("#Content_Order").val();
var link = $form.find("#Content_Link").val();
var title = $form.find("#Content_Title").val();
$("#input_Order_" + rowNum).val(order);
$("#input_Link_" + rowNum).val(link);
$("#input_Title_" + rowNum).val(title);

Is there a way that I could replace the code above with a loop for each input values on the form that have a class of update-grid and then updates the table fields where the last part of the names match ?

  • 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-10T00:39:41+00:00Added an answer on June 10, 2026 at 12:39 am

    Try this:

    $('.update-grid').each(function(){
       var id = this.id.replace('modal', '');
       $('#input'+id).val(this.value)
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html code: <form> <table> <tbody> <tr> <td> <span>Quantity<span class=pull-right>3</span> <input
I have following table. <form method=post action=test.php> <input name=id[] type=text value=ID1 /> <input name=value[]
I have the following two html form inputs: <input type=text class=faded name=mobile value=012-245-6789 onfocus=hideDefault(this)
I have the following code: echo ' <td> <input type=button name=delete value=X onclick=clearSelection(this.form, '.$type.');this.form.submit();
We have the following form: <form> ... <table width=100% cellspacing=0 class=datagrid_ppal> <tbody> <tr> <th
I have following code in a html form <select name=category class=input onchange=ShowTB(this,'suggest');> <option value=0
I have following html form: <form method=post action=> <input type=hidden name=userid id=user value=<?php echo
I have the following form code: <input data-color=orange id=vote_color_id_2 name=color type=radio value=2 />Orange <input
I have the following form <form id=enter_email method=post action=> <input type=text value=enter email />
I have the following form input field: <input type=text value= title=Enter item description name=description>

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.