Search code examples
javascriptphpapirecurly

Two forms - one submit button?


I have TWO forms on my website.

Is it possible when I submit one of these, it will take form data from a particular field in the other form?

I am using the Recurly system with PHP.


Solution

  • You can write your own function.

    function submit (){
       document.getElementById("firstform").submit();
       document.getElementById("secondform").submit();
    }
    

    You can then make a button that calls this function.

    If this doesn't work, try again using ajax. Example