www.webdeveloper.com
Results 1 to 5 of 5

Thread: popup input to sql?

  1. #1
    Join Date
    Apr 2010
    Posts
    19

    popup input to sql?

    Hi Guys.
    I need a javascript prompt popup which allows the user to input 1 line of text, when they submit it, it will update a sql table using php.

    The reason is for a user to decline a job, when they click 'reject job' it will popup and ask for a reason.
    The reason will be stored in mysql.

    Please help!
    Last edited by adamck; 02-14-2011 at 04:50 AM.

  2. #2
    Join Date
    Feb 2011
    Posts
    7

    Re:Popup input to SQL

    Yo can use prompt function. From it you can take the input and then update the database accordingly
    like that:
    Code:
    prompt("Please enter your name","Your name");

  3. #3
    Join Date
    Apr 2010
    Posts
    19
    Hi,
    I can make the promp ok, and i can pull the variable using this tutorial
    http://www.w3schools.com/JS/js_popup.asp

    how do i send the variable to php/sql without refreshing the page?
    This is the part im stuck with

    I want
    User presses button - popup requests a comment and presses ok - comment is then entered into sql table - user is back where he started.

  4. #4
    Join Date
    Jan 2006
    Location
    Indiana, USA
    Posts
    79
    The only way to do it without submitting the page is with AJAX techniques. Otherwise, you'll have to submit the page to send the data to the server.

  5. #5
    Join Date
    Apr 2010
    Posts
    19
    i am aware of this.
    I was hoping for some code example of this i could then try or play with?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles