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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:51:09+00:00 2026-06-10T11:51:09+00:00

I’ve got very little javascript programming skill, so this must be the problem with

  • 0

I’ve got very little javascript programming skill, so this must be the problem with it. My problem is not so complicated, but I just can’t find the answer for it, I tried nearly everything, but as I said, I’m lame in javascript programming.

My problem is, that I have got a php page, on this page there are multiple forms generated by mysql queries. I use them to post dynamiccally generated hidden field values to another php file and in that file I can use their post values without refreshing the main page. The form id’s (or names) are also generated by the mysql queries. I use javascript to validate (?) a form and send it’s hidden contents to the another page.

Javascript:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
        $("#1").validate({
            debug: false,
            submitHandler: function(form) {
                $.post('process_like_dislike.php', $("#1").serialize(), function(data) {
                    $('#results').html(data);
                });
            }
            });
    });
    </script>

As you can see, the form id in this case is 1. I generate nearly 40 unique forms on one page, it depends on the mysql queries.

Php:

<form name='$formnumber' id='$formnumber' action='' method='POST'>
<input type=hidden value='$us_id' name='us_id' id='us_id'>
<input type=hidden value='$an_id' name='an_id' id='an_id'>
<input type=hidden value='1' name='on' id='on'>
<input type=submit class=something value='' title='Something'>
</form>

I don’t know how should I make the javascript code to dynamically validate the chosen form on submit. I tried to get the php formnumber variable in the javascript, but that didn’t help. I don’t know if there is another way, but I only know this one. I need to pass the dynamically generated hidden values to another page, but I need a dynamically generated javascript for it, or I don’t know.

The main concept of this code, that I made a page where you can rate a thing and that thing has got hidden values that I need to get in post format, because this is the only way that I can decide which button has been pressed to do the mysql query in the second php file without refreshing the current one. I don’t want simple posts, because I would lose the previous page and I don’t want to refresh the page.

Please help me out, thank you guys.

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

    @Michael Wheeler’s solution is more elegant than what I came up with originally — however, ‘this’ is not set to the form (I tested) so you’d have to change his solution to $(form) for the other $(“#1”) instead of $(this) and it’ll work perfect. =)

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't

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.