| | |
JavaScript - Data Validation between two fields
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2008
Posts: 381
Reputation:
Solved Threads: 33
Have a look at this
Hope it helps
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <script type="text/javascript"> function compare () { var one = document.getElementById('one'); var two = document.getElementById('two'); if ( one.value.substring(0,1) == two.value.substring(0,1) ) { alert( 'same letter, same case' ); } else if ( one.value.substring(0,1).toLowerCase() == two.value.substring(0,1).toLowerCase() ) { alert( 'same letter, different case' ); } else { alert( 'different letters' ); } } </script> </head> <body> <form onsubmit="compare()"> <input id="one" type="text" /> <input id="two" type="text" /> <input type="submit" /> </form> </body> </html>
![]() |
Similar Threads
- setting up an automatic email reply from a form. (Site Layout and Usability)
- Dot Net programmer wanted. Work from home. (Web Development Job Offers)
- ASP.NET Registration Page (ASP.NET)
- problems with php web form (PHP)
- javascript required fields 290 form elements (JavaScript / DHTML / AJAX)
- Entires become blank in jsp (JSP)
- form validation not working (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: img rollover help
- Next Thread: Password field
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array beta box browser captchaformproblem cart child class close codes column css date debugger decimal dependent design disablefirebug dom download editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe index java javascript javascripthelp2020 jquery jsf jsp jump libcurl listbox maps masterpage math media menu microsoft mimic mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php player position post problem programming prototype redirect safari scale scriptlets scroll search security select software toggle unicode variables w3c web window windowofwords \n





