Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset='utf-8'/>
- <title>Simple Validation</title>
- <script type="text/javascript">
- function validasi(frm){
- if(parseFloat(frm.bayar.value)>parseFloat(frm.tagihan.value)){
- alert('kelebihan..');
- }else{
- frm.submit();
- }
- }
- </script>
- </head>
- <body>
- <form name="frm" method="post" action="#1" onsubmit="validasi(this);return false;">
- <label>tagihan anda<label>
- <input type='text' name='tagihan' id='tagihan' value='200000'/><br />
- <label>bayar tagihana<label>
- <input type='text' name='bayar' id='bayar' value=''/><br />
- <input type='submit' value='submit'/>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement