Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. How can I submit with 1 button and 1 form with 2 actions?

How can I submit with 1 button and 1 form with 2 actions?

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
questionjavascriptphpdatabasemysql
3 Posts 3 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amitb2
    wrote on last edited by
    #1

    index.php

    PHP MySQL Insert Tutorial
        
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
            
    Insert
    

    2nd.php

    minus

    js

    $('#myform').submit(function(){
    return false;
    });

    $('#insert').click(function(){
    $.post(
    $('#myform').attr('action'),
    $('#myform :input').serializeArray(),
    function(result){
    $('#result').php(result);
    }
    );
    });

    Richard DeemingR 1 Reply Last reply
    0
    • A amitb2

      index.php

      PHP MySQL Insert Tutorial
          
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
              
      Insert
      

      2nd.php

      minus

      js

      $('#myform').submit(function(){
      return false;
      });

      $('#insert').click(function(){
      $.post(
      $('#myform').attr('action'),
      $('#myform :input').serializeArray(),
      function(result){
      $('#result').php(result);
      }
      );
      });

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      You have already posted this in the Web Development forum: How can I submit with 1 button and 1 form with 2 actions? - Web Development Discussion Boards[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      L 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        You have already posted this in the Web Development forum: How can I submit with 1 button and 1 form with 2 actions? - Web Development Discussion Boards[^]


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I had a feeling I had already seen it, but his homepage shows a Messages count of 0. I think counting and adding has gone a bit awry here: Bugs and Suggestions[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups