Tuesday, April 21, 2009

Difference between and

<input type="button" /> buttons will not submit a form -
In Ajax, it is for client side stuff.
They're generally used in conjunction with JavaScript as part of an AJAX application.

<input type="submit"> buttons will submit the form to the serveri side.
UserController/Action will process submitted information

Friday, April 17, 2009

Simplest example for JQuery validation

<html>

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js">
</script>
<script>

$(document).ready(function(){
$("#contactForm").validate();
});
</script>


<body>
<div id="container">
<form id="contactForm" method="" action="">
<label for="cemail">E-Mail</label>
<input id="cemail" name="email" size="25" class="required email" />
<input id="number" name ="number" class="required number"/>
<input class="submit" type="submit" value="submit"/>
</form>
</div>

</body>
</html>

Thursday, April 16, 2009

Boxy/JQuery

Source
Simple stuff only.

JQuery selector and getElementById

Javascript:
document.getElementById('product_id_01')

JQuery selector:
$('#product_id_01')[0]

Wednesday, April 15, 2009

How to debug Javascript/JQuery in VS2008

1. In browser: Enable script debugging
2. In VS 2008: Run the project first. Do not set breakpoint in your document first
3. In VS 2008: Check your solution explorer on the top. You will find [script document]. Double click to open html page and set breakpoint.