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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:20:15+00:00 2026-06-17T07:20:15+00:00

I am new to JavaScript, so pardon my lack of knowledge. I am trying

  • 0

I am new to JavaScript, so pardon my lack of knowledge.

I am trying to code a contact form and want to get the value entered in a particular input text field as soon as a value entered by the visitor using AJAX and pass it to a PHP string so that I can show relevant information based on the value entered before hitting the submit button.

How Can I do that using jQuery?

Here are the codes I am using for the form:

<form method="post" action="">
<input type="text" id="name" name="name" />
<input type="text" id="email" name="email" />
<input type="text" id="subject" name="subject" />
<input type="text" id="url" name="url" />
<input type="checkbox" id="showdetails" name="showdetails" /> Show URL Details
<input type="submit" value="Submit" />
</form>`

I need the value of the URL input field to pass to a php string (as soon as the user checks the showdetails checkbok) so that I can process it in background to show information based on the url.

  • 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-17T07:20:17+00:00Added an answer on June 17, 2026 at 7:20 am

    Given this html:

    <form method="post" action="">
    <input type="text" id="name" name="name" />
    <input type="text" id="email" name="email" />
    <input type="text" id="subject" name="subject" />
    <input type="text" id="url" name="url" />
    <input type="checkbox" id="showdetails" name="showdetails" /> Show URL Details
    <input type="submit" value="Submit" />
    </form>
    

    jQuery (checkbox)

    $(function() {
      $("showdetails").on("click",function() {
        var url = $("#url").val();
        if (url && $(this).is(":checked")) {
          $.get("relevantinfo.php",
            { "url": url },
            function(data){
              // do something with data returned
            }
          );
        }
        else {
          // clear relevant info here
        }
      });
    });
    

    The receiving end: Retrieving POST Data from AJAX Call to PHP

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

Sidebar

Related Questions

I'm very new to js and jQuery, pardon my bad code. Trying to dynamically
I'm relatively new javascript, but I am comfortable in other languages. I'm trying to
New to javascript and such, trying to create a loop for fading logos using
im new at javascript and i can get this slider to work but not
I am mostly a backend developer. And very new to javascript. So pardon my
Given a string classname , I want to dynamically create a new JavaScript function
As a new javascript developer, I have spent some time with this code snippit
I'm very new to Grails so pardon me, what I want to do may
While trying to do this: my $obj = new JavaScript::Minifier; $obj->minify(*STDIN, *STDOUT); // modified
I am very new Javascript and am messing around trying to make a simple

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.