Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Get output from php using jquery

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #28300
    dcp3450
    Participant

    I’ve been looking into $.post, $.get, and $.ajax to get my desired result but I can’t seem to make headway. Here is what I’m trying to accomplish:

    3 files: index.php, file.js, output.php

    index.php:
    user inputs text in a box

    file.js:
    using .change() or .blur() the jquery pulls in the text and sends the value to output.php.

    output.php:
    takes the value and compares it to an array. if a match is found a message is displayed on index.php

    I have all the pieces of the puzzle. Just can’t quite to get them to fit. Any ideas?

    #72093
    Rob MacKay
    Participant

    probably need a little more info than that to be honest :) Can you give any more detail?

    #72095
    dcp3450
    Participant

    Basically the form will store data to a database. I’m trying to dynamically check to ensure the field pageName doesn’t already exist.

    When the user enters text into the textbox and loses focus I want the jquery/javascript to send the value of the textbox to php, have php check if the name is on the database by pulling the names with a select query and comparing the results. if a match is found a message that says "name exists" will display next to the textbox.

    #72096
    Rob MacKay
    Participant
    #72085
    dcp3450
    Participant

    yep! perfect. Turns out my code was almost spot on. Had to make a few adjustments that I didn’t see. thanks!

    #72102
    Rob MacKay
    Participant

    awesome :D

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.