Language: HTML
Simple MVC Example of inline Delete Button with hidden id field
<% for (int i = 0; i < 10; i++) { %> <div class="emailAddress"> <label>jimbo@example.com</label> <%= Html.Hidden("asdf", Guid.NewGuid()) %> <a href="javascript:void(0);">Delete</a> </div> <% } %> <script type="text/javascript"> $(document).ready(function() { $(".emailAddress").each(function(i, el) { var anchor = $(el).children("a").get(0); // Assign click handler $(anchor).click(function() { var hidden = $(anchor).siblings(":input[type='hidden']").get(0); alert(hidden.value); }); }); }); </script>
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

