Javascript-o-rama

Out of context: Reply #13

  • Started
  • Last post
  • 23 Responses
  • stewdio0

    JavaScript allows you to modify, append, and even delete entire chunks of HTML by manipulating the document's "elements." I think you're looking to do the following (TOTALLY UNTESTED!) sort of thing :

    var myForm = document.getElementById( "songForm" );
    myForm.onSubmit = "download.php";

    var myButton = document.getElementById( "btnDownload" );
    myButton.onClick = "myValidation()";

    function myValidation()
    {
    // Validate form here
    var myForm = document.getElementById( "songForm" );
    // ---- add whatever you need to do with the data ---

    // Then submit
    myForm.submit();
    };

View thread