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

The Archive Base Latest Questions

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

what I am doing is creating a form using JSON this form can then

  • 0

what I am doing is creating a form using JSON this form can then be edited a and produce new JSON object. The problem I am having seems to be with getting the form id.
The code I am using to return a JSON object is:

form = document.forms[0];
$.fn.serializeObject = function()
{
    alert("start serializeObject");
    var o = {};
    var a = this.seralizeArray();
    $.each(a, function(){
        if (o[this.name] !== undefined) {
            if (!o[this.name].push) {
                o[this.name] = [o[this.name]];
            }
            o[this.name].push(this.value || '');
        } else {
            o[this.name] = this.value || '';
        }
    });
    return o;
    alert(o);
};

$(function() {
    alert("here");
    form.submit(function(){
        result.append(JSON.stringify(form.serializeObject()));
        return false;
    });
});

This just refresh’s the pageI am not sure why.
This program is not on a server and not be used on a server.
by this I mean It is only every going to be run locally on a local machine, with no apache2 setup.

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

    You code can be written pretty easy. This is how I do it:

    Ajax:

    $('#formID').on('submit',function () {
        $.ajax({
            url: 'submit.php',
            cache: false,
            type: 'POST',
            data : $('#formID').serialize(),
            success: function(json) {
                alert('all done');
            }
        });
    });
    

    If you are not sending it with Ajax, why would you do this? If you are simply submitting the form, you can do it using PHP like this:

    <?php
    $json_object = json_decode($_POST);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing this tutorial: http://www.phpeveryday.com/articles/Zend-Framework-Database-Creating-Input-Form-P494.html We are building a simple input form using POST
I'm currently creating a neighbourhood graph by doing roughly this: for every voxel look
While creating sharing links for facebook, you can personalize a sharing link by doing
Anyone can tell me what I'm doing wrong? I am creating a simple system
I am trying to create a car make/model form using Javascript or AJAX, problem
having my first attempt at rounded corners in a login form. Just doing the
I am creating an application for an ipad and i am doing it using
First time posting so I hope I'm doing this right. I'm creating a custom
I have been using form inheritance for a while now but without doing much
I have created a django application. Using this app users can be created or

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.