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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:37:44+00:00 2026-06-17T12:37:44+00:00

I tried to build an application using Javascript, HTML, CSS, AJAX, JSON in which

  • 0

I tried to build an application using Javascript, HTML, CSS, AJAX, JSON in which client fill a form and send to server , and after that server respond to client.

For this problem, I have done these steps,

  1. Firstly I build a HTML page having form.
  2. Then, I send the information to javascript by using onClick event handler.
  3. Then, I build a JSON object that have form information.

and the code for that is,

HTML CODE :-

<div id="stylized" class="myform">
            <form name = "user_form" action = "operation.js" method = "post">
                <h1>Sign-up form</h1>
                <p>This is the basic look of my form without table</p>

                <label>Name
                <span class="small">Add your name</span>
                </label>
                <input type="text" name="name" id = "name_data"  /><br>
                <p id = "name_update"></p><br>

                <label>Email
                <span class="small">Add a valid address</span>
                </label>
                <input type="text" name="email"  /><br>
                <p id = "email_update"></p><br>

                <label>Url
                <span class="small">Complete URL</span>
                </label>
                <input type="text" name="url"  />

                <label>Comment
                <span class="small">That you want to say</span>
                </label>
                <textarea type="text" name="comment"  ></textarea>

                <button type="button" name = "button"  onClick="operatn(this.form)">Submit</button>
                <div class="spacer"></div>
                <h4 align = "center" id = "submit_update"></h4>
                <div class="spacer"></div>
            </form>
        </div>

JAVASCRIPT CODE :-

function operatn(x) {
    var name1 = x.name.value;
    var email1 = x.email.value;
    var url1 = x.url.value;
    var comment1 = x.comment.value;
    //alert(comment);

    var txt = '{ "details" : [ ' +
                        ' { "name_key" : "name", "name_value" : "' + name1 + '" }, ' + 
                        ' { "email_key": "email" , "email_value" : "' + email1 + '" }, ' +
                        ' { "url_key" : "url" , "url_value" : "' + url1 + '"  }, ' +
                        ' { "comment_key" : "comment" , "comment_value" : "' + comment1 + '" } ] }';

    var obj = eval( "(" + txt + ")" );
    //alert(obj.details[3].comment_value);

}

But I confused in, How to send this object to server? (tell me the
code for that or any good link) and,

How client establish an
connection with server that have IP address and Port number information of server.

Help me . 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-17T12:37:46+00:00Added an answer on June 17, 2026 at 12:37 pm

    What you are missing is the ‘ajax’ part of your code, your code needs to make a request to the server. This is done using an XMLHttpRequest.

    Using jQuery which abstracts XMLHttmlRequest,

    function operatn(x) {
        $.ajax({
           url:"http://yoursiteurl.com",
           data:{
               comment:x.comment.value,
               email: x.email.value,
               url:x.url.value,
               name:x.name,value,
           }
        }).done(function(serverResponse){
             //here you can handle server response
        }).fail(function(err){
             //here you can handle errors
        });
    
        //alert(obj.details[3].comment_value);
    
    }
    

    Just don’t forget it is asynchronous.

    Edit: I changed the key value pairs a bit since JSON objects are key value pairs.

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

Sidebar

Related Questions

I tried to build an application in which , there is one HTML page
I'm trying to server HTML Javascript and CSS content from an iPhone application's local
I'm looking to build a tree-like structure for my Java application. I've tried using
I'm using java studio creator to build my application. I used the ajax component,
when tried to build a AIR application for android using flex builder I did
I am new in Javascripting language. I tried to build an application in which
Has anyone tried to build an e-commerce site atop MS Dynamics, using the new
I tried to reuse the .pch to speed the build using the following way:
I'm trying to build an application using ant. Everything appears to be fine when
greetings all i have a web application using (spring-hibernate) frameworks and when tried to

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.