$Form.FormTag("%{id='myform'}")
$Form.TextField("email")
<button id="addbutton">Add</button>
<button id="removebutton">Remove</button>
$Form.EndFormTag()
<script>
Event.observe(window, 'load', function() {
Event.observe('addbutton', 'click', function() {
$('myform').action = '$Url.For("%{action='addemail'}")';
$('myform').submit();
return false;
});
Event.observe('removebutton', 'click', function() {
$('myform').action = '$Url.For("%{action='removeemail'}")';
$('myform').submit();
return false;
});
});
</script>
I used http://www.manoli.net/csharpformat/ to format the code.
No comments:
Post a Comment