Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<script type="text/javascript">
        $(function () {
                    //mode: "specific_textareas",
                    selector: '#mytextarea'
                //skin: 'red'
            $("#btnUpdate").click(function () {
                alert("button"); // Remove this line if it worked

<pre> <div id="tblMain" class="tableSpaced" style="width:auto;height:100%;margin-left:25px;">

<div id="tblMainAlt" class="tableSpaced" style="width:auto;height:100%;margin-left:25px;">

<input id="btnUpdate" type="submit" value="Update" class="html-button" onclick="location.href= '@Url.Action("UpdateEmailTemplate", "EmailTemplate");'" />

What I have tried:

I tried
$("#btnUpdate").click(function () {
                alert("button"); // Remove this line if it worked
F-ES Sitecore 27-Mar-17 8:46am    
You need to stop the button click from continuing or else the form will submit. You also have an in-line onclick taking you to an action. So what do you want to do when the button is clicked? Show\hide divs? Submit the form? Go to the action? Pick one as you can't do all three.
Shridhar Salunkhe 27-Mar-17 8:52am    
what shld i do then?
Shridhar Salunkhe 27-Mar-17 8:56am    
How to access div id into action in controller
Dave Kreskowiak 27-Mar-17 9:01am    
You don't. Why would you want to?
Bhola Ram Sahu 19-Apr-17 1:46am    
Add runat="Server" to access the div in controller

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