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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:10:43+00:00 2026-06-17T08:10:43+00:00

function ajaxCheck(){ var inpUs = $(#user).val(); $.post( ./inpCheck.php, { user : inpUs }, function(data)

  • 0
function ajaxCheck(){ 
    var inpUs = $("#user").val(); 
    $.post(
        "./inpCheck.php",
        { user : inpUs }, 
        function(data) { // here is the point
            if (data.length > 0) { 
                $("#spanUser").html(data); 
            } 
        }
    ) 
} 

This checks if a user already exists, and it works, but instead of $.post("./inpCheck.php", I want to refer to a specific part (function) of that file ?
Because, on the same file I want to write code for another inputs.

  • 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-17T08:10:44+00:00Added an answer on June 17, 2026 at 8:10 am

    That’s not possible, what you can do is use switch in php, like

    js part

    $.post("./inpCheck.php", {user : inpUs, act_name : "some_function"}, function(data){
    ..
    

    and in inpCheck.php

    $action = $_POST['act_name'];
    switch($action) {
      case "some_function":
         call_some_function();
      break;
    }
    //somewhere in same page
    function call_some_function() {
      //your code here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function checkuser(user) { var ret = false; $.ajax({ type:'POST', url:'user.php', async:false, data:{'user':user}, success:function (data)
function addrewarddb() { var rval=98; $.post(db/mkreward.php,{ proid:getURLParameter(id) },function(data){ rval=99; alert(rval); }); alert(rval); return rval;
function show_destination(country_id,airport_id){ $.ajax({ type: POST, url: function.php, data: country_id=+country_id+&airport_id=+airport_id+&action=destination, beforeSend: function() { $(#loader_destination).html(''); },
function check_username(){ $.ajax({ type: POST, dataType: 'json', url: /ajax/check/username.html, data: via=ajax&username=+$('input[name=register_username]').val(), success: function(msg){ if(msg.response==false){
function contentDisp() { $.ajax({ url : a2.php, success : function (data) { $(#contentArea).html(data); }
function getWindowsUserName() { var WinNetwork = new ActiveXObject(WScript.Network); var urlToSite = http://localhost/index.php?nph-psf=0&HOSTID=AD&ALIAS= + WinNetwork.UserName;
function getDbValue() { alert($('[data-bind]').length); alert($('[data-bind][0].data-bind')); alert($('[data-bind][0].value')); jQuery.each($('[data-bind]'), function(databind,key) { alert(key); alert(databind); alert(databind[key].data-bind); }) }
function getData(jsonAddress) { var data = new Array(); var xhr = $.getJSON(jsonAddress, function(meas) {
function(data, textStatus, jqXHR) { $(#info).html(data); if ((data).substr(0, 5)==Please) {$(#imgOk).fadeIn();} // doesn't work data is
function trim(str,options){ var string = str.replace(/^\s\s*/, ''), ws = /\s/, i = str.length, j

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.