Dear Team - Hello to Everyone!!!

pleae note that i m trying jump to test.php page from index.php/html using ajax and mysql, simple if text-input not found in table so it should go to test.php else stay on index.php/html page with ajax alerts, but from index page everytime receiving NOT AVAILABLE and sometime submit button not functional, below code FYR...

$(document).ready(function() {

                //default form not submitted

                //preventing enter key in input field from submitting form
                $("#welcome").on("submit", function(e){
                    if($('#submit').data("submitted")===false) {

                 //trigger form submission

    //default form not submitted                
    function validate() {

                    var num = $('#invst_num').val();
                    type: 'POST',
                    url: 'check_test.php',
                    data: num,
                    cache: false,
                    dataType: "json",
                    success: function(data) {

                                alert("NOT AVAILABLE");
                            } else {
                                $("#submit").data("submitted", true);



<form action="check_test.php" method="post" name="welcome" id="welcome" />
<table width="550" border='0' align='center' cellpadding='0' cellspacing='0'>


    <td align="center"><label>
      Enter Inv. # *: 
        <input name="invst_num" type="text" id="invst_num" size="40"  /> 
      <input name="submit" type='submit' id='submit' />



    include ("config/config.php");

    //get the username

    if (isset($_POST['submit'])) {
    $invst_num = $_POST['invst_num'];

    //mysql query to select field username if it's equal to the username that we check '
    $sql = mysql_query("select invst_num_ar from shareholders_ar where invst_num_ar =  '$invst_num' "); 
    if ($result = mysql_num_rows($sql)>0) {
        echo ($result);

    // if not found...test.php should load
    Register Data


can anyone please assist on subject request!

Thanks & Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.