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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:36:23+00:00 2026-06-02T05:36:23+00:00

i am capturing the value of changed fields via JS Event and capturing that

  • 0

i am capturing the value of changed fields via JS Event and capturing that data into temp1 array, say, if u change field name “name”, then it will get the field name “id” and will store it into temp1. but the main problem is how can i pass this array to a php form processing page, where i can get the value of this temp1.

i tried using JSON but it’s not helping me out.

the code which i tried was: $.post(‘/somepage.php’, temp1); but it didnt work.

please help me out with this.

and i included jquery.js lib in the page.

  <script type="text/javascript">
  var temp1 = new Array();

  function onChangeTest(changeVal)
  {    
 //alert("Field u changed was: " + changeVal.id) 

 temp1.push(changeVal.id);

 tmsg = "Fields u changed so far are:"
 for(var i=0;i<temp1.length;i++)
 {
 //document.write("<b>temp1["+i+"] is </b>=>"+temp1[i]+"<br>");
 tmsg = tmsg + " " + temp1[i];
 }
 alert(tmsg);
 }
 //$.post('/somepage.php', temp1);
 </script>
  • 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-02T05:36:24+00:00Added an answer on June 2, 2026 at 5:36 am

    The problem looks quite simple to me , try below code and let me know the outcome..

    function onChangeTest(changeVal)
    {
        //alert("Field u changed was: " + changeVal.id)
        var temp1 = new Array();
        temp1.push(changeVal);
    
        tmsg = "Fields u changed so far are:"
        for(var i=0;i<temp1.length;i++){
            //document.write("<b>temp1["+i+"] is </b>=>"+temp1[i]+"<br>");
            //tmsg = tmsg + " " + temp1[i];
            var newHidInp = document.createElement('input');
            newHidInp.type  = 'hidden';
            newHidInp.name  = 'outArray[]';
            newHidInp.value = temp1[i];
            document.frm.appendChild(newHidInp);
        }
        return false;
    }
    

    HTML:

     <form name="frm" action="" method="POST" >
      <tr>
    <td><font color="red">*</font>Name:<input type="text" name="name" id="name" size="25" onkeyup="onChangeTest('name')" /></td>
    <td><font color="red">*</font>Age<input type="text" name="age" id="age" size="25" onkeyup="onChangeTest('age')" />
    <input type="submit" name="submit" value="SUBMIT">
    </td>
    </form>
     </body>
    </html>
    

    PHP:

    <?php
    print("<pre>");
    print_r(array_unique($_POST['outArray']));
    
    ?> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that is capturing data sent from a google LocalSearch API.
I'm creating a data capturing page with drop down lists that are dynamically filled
I have an input. <input name=inputName id=inputId value=Hello /> Lets pretend that the cursor
when capturing events in the Automation event editor of Instruments (with the neat record
Am working on file / folder event capturing of OS X 10.5 and 10.6
Wondering if it's possible to change a value returned from a queryset before sending
I am working on a small C application and I am capturing a value
There are multiple posts on here that capture value , but I'm just looking
I am building a WPF application that takes in rows of data, and outputs
I am capturing data from the inserted and deleted tables as xml and saving

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.