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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:25:06+00:00 2026-06-13T00:25:06+00:00

I have a registration form that on submit, validates passwords and domain names that

  • 0

I have a registration form that on submit, validates passwords and domain names that match respectively. If true, I am trying to then check that the domain name does not exist in the DB via an ajax request.

<div class="grid-6">
                <p>
                    <label for="First Name">First Name:</label>
                    <input type="text" name="first_name" placeholder="James" required value="">
                    <label for="Last Name" name="lastname">Last Name:</label>
                    <input type="text" name="last_name" placeholder="Brown" required value="">
                    <label for="email">Email:</label>
                    <input type="email" name="email" placeholder="email@email.com" required value="">
                    <label for="Preferred Password">Preferred Password:</label>
                    <input id="og_password" type="password" name="password" required value="">
                    <label for="Confirm Password">Confirm Password</label>
                    <input id="confirm_password" type="password" name="password_confirm" required value="">
                </p>
            </div><!-- /grid-6-->
            <div class="grid-6">
                <p>
                    <label for="Domain Name">Domain Name <span class="italic red">(lowercase letters and numbers only - no spaces):</span></label>
                    <input id="domain_name_a" type="text" name="domain_name_a" placeholder="mystudioname" required value="">
                    <label for="Domain Name">Confirm Domain Name:</label>
                    <input id="domain_name_b" type="text" name="domain_name_b" placeholder="mystudioname" required value="">
                </p>
            </div>

JS

unction passwordMatch() {
var pass1 = $('#og_password').val();
var pass2 = $('#confirm_password').val();

var domain1 = $('#domain_name_a').val();
var domain2 = $('#domain_name_b').val();

var error = true;

if(pass1 != pass2){
    alert("Your passwords do not match!");
    return  false; // cancel form submission if passwords don't match
}
if(domain1 != domain2){
    alert("Your domain names do not match!");
    return  false;
}
//no errors check DB for domain exits
checkDomain(domain1);
}

    function checkDomain(domain) {
        alert(domain);//testing only
        $.ajax({
            type:"POST",
            url: "/actions/domain.php",
            data: {
                domain:domain
            }
        success: function(result) {
            if(result = false) {
                alert(result);
            } else {
                alert(result);
            }
        }
        });
    }

Things run well through the alert(domain), which is returning the correct value. The problem is somewhere in the domain.php file, the return, or just plain incorrect use of the .ajax. Here is the php

PHP

<?php
    require_once("../includes/connection.php");

    $domainName = $_POST['domain'];

    $sql = "SELECT domain_name
            FROM user
            WHERE domain_name = '{$domainName}'
            ";
    $run = mysqli_query($mysqli, $sql);
    $result = mysqli_fetch_assoc($run);
    echo $result['domain_name'];
?>

Any help on where I have gone wrong on this would bea appreciated.

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-13T00:25:07+00:00Added an answer on June 13, 2026 at 12:25 am

    If that was a direct copy of your code – you’re missing a comma in the ajax call after data: {}, <- right there.

    Also, remove the if…else from the success statement, because it’s not done right as well (you’re testing a value by using ONE equal sign, and all that does is just declare the value you’re trying to test against). Just try: success: function(result) { console.log(result); alert(result); } and see what you get.

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

Sidebar

Related Questions

I have a registration form. When I hit the Submit button it should check
I have a log in form that I am trying to submit via AJAX.
I'm trying to check that the fields in the form below have been filled
I have a basic form that I'm using for member registration. I'm using the
I was trying to sign-up Twitter today and I noticed that their registration form
I have a big registration form that I've devided with jquery cycle so you
I have a registration form that is rendered by the following urlconf -- url(r'^$',
I am trying to set-up a registration form that sends a welcoming email to
I have simple registration form. Once all information entered, user click submit button and
I have built a simple registration form shown below and Iam trying to get

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.