SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    167
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Button name passed through

    Any idea how to accomplish this?

    Code JavaScript:
    requestform.onsubmit = function ()
    {
    	/* So what to do here, thats the question
     
    	- I want to get the data / NAME of a button that has been pressed, if such function exists.
    	- Then I need to use AJAX to send the form data to some file that probably doesnt exist yet.
    	- Give the PHP a response, and echo the response to replace the buttons
     
    	*/
     
    	return false;
    }

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    The best resource for what you're dealing with is a book called Bulletproof Ajax which also provides all of the code and examples from the book.

    If you don't want to learn such details of how to do it, code libraries such as jQuery help to dramatically simplify the code you need to write.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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