Fallen_angel Posted December 12, 2006 Share Posted December 12, 2006 Hi, I need to run two different functions as an html form is submitted the format I have been trying to set it up with is [code]<form enctype="multipart/form-data" name="StrainReport" method="post" onsubmit="html2entities(this.pheno_notes,this.add_comments,this.image_comments2,this.image_comments1)" onsubmit="return validate_form(this)" action="submit_report.php"> [/code]the above code ofcourse runs the first function but it skips the seccond OnSubmit , I have tried [code]<form enctype="multipart/form-data" name="StrainReport" method="post" onsubmit="if return validate_form(this) then html2entities(this.notes,this.add_comments,this.image_comments2,this.image_comments1)" onsubmit="" action="submit_report.php">[/code]What is it that I am doing wrong or have i totally got the wrong idea on how to do this ?thanx to anyone that can help me get this working Quote Link to comment Share on other sites More sharing options...
alpine Posted December 12, 2006 Share Posted December 12, 2006 You must run them under the same onsubmit attribute:example:[code]onsubmit="html2entities(this.pheno_notes,this.add_comments,this.image_comments2,this.image_comments1); validate_form(this);"[/code]...should work Quote Link to comment Share on other sites More sharing options...
mithu_sree Posted December 13, 2006 Share Posted December 13, 2006 above should work u can try this one alsoon submit="function1()"and inside [code]function1() { function2(); function3()}[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.