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 Link to comment https://forums.phpfreaks.com/topic/30331-running-two-functions-onsubmit/ 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 Link to comment https://forums.phpfreaks.com/topic/30331-running-two-functions-onsubmit/#findComment-139588 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] Link to comment https://forums.phpfreaks.com/topic/30331-running-two-functions-onsubmit/#findComment-140154 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.