Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i wants to call form action attribute after executing onclick event in a button.How can we do that task.

Thank you.


Lakshman
Posted
Comments
CHill60 15-Jun-13 10:39am    
What have you tried so far and what is the specific problem that you have. Use the Improve question link above

1 solution

In aspx page

XML
<script type="text/javascript" language="javascript">

    function sendMail() {
        document.getElementById('form1').action = "http://sitename/modules/Webforms/capture.php";
        document.getElementById('form1').method = "post";
        form1.submit();
    }


</script></script>





In .cs page
protected void btnsubmit_click(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "ResizeRadWindow", "<script type='text/javascript'> sendMail(); </script>");
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900