Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Java Control Validation on ASP.NET

Java Control Validation on ASP.NET

Scheduled Pinned Locked Moved ASP.NET
csharpjavajavascripthtmlasp-net
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kinsella_john
    wrote on last edited by
    #1

    I have been told by many people that javascript is the way forward for validating the amount of characters in a field, however i have tried several snippets of java code (that work in an html document) and i cant seem to get them to function alongside my aspx page. this is proving to be quite a pain as it is putting the breaks on my progression, i need to learn javascript and am doing so bit by bit, but more importantly i need practice with asp.net coding. this is why i am creating an application, but this is a necessary part of it. below is the link to the code i have tried.. i have tried substituting the names in all field and cant really see why it wouldnt work. any help, or code, or anything really would be much appreciate. and if it is easier by viewing my code let me know and i will post it.... http://javascript.internet.com/forms/val-pass.html many thanks, John Kinsella

    John Michael Kinsella kinsellajohn@hotmail.com

    S 1 Reply Last reply
    0
    • K kinsella_john

      I have been told by many people that javascript is the way forward for validating the amount of characters in a field, however i have tried several snippets of java code (that work in an html document) and i cant seem to get them to function alongside my aspx page. this is proving to be quite a pain as it is putting the breaks on my progression, i need to learn javascript and am doing so bit by bit, but more importantly i need practice with asp.net coding. this is why i am creating an application, but this is a necessary part of it. below is the link to the code i have tried.. i have tried substituting the names in all field and cant really see why it wouldnt work. any help, or code, or anything really would be much appreciate. and if it is easier by viewing my code let me know and i will post it.... http://javascript.internet.com/forms/val-pass.html many thanks, John Kinsella

      John Michael Kinsella kinsellajohn@hotmail.com

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      Can you post the Javascipt code ?

      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      K 1 Reply Last reply
      0
      • S Sandeep Akhare

        Can you post the Javascipt code ?

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        K Offline
        K Offline
        kinsella_john
        wrote on last edited by
        #3

        <!-- Original: Russ Swift (rswift220@yahoo.com) --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function validatePwd() { var invalid = " "; // Invalid character is a space var minLength = 6; // Minimum length var pw1 = document.myForm.password.value; var pw2 = document.myForm.password2.value; // check for a value in both fields. if (pw1 == '' || pw2 == '') { alert('Please enter your password twice.'); return false; } // check for minimum length if (document.myForm.password.value.length < minLength) { alert('Your password must be at least ' + minLength + ' characters long. Try again.'); return false; } // check for spaces if (document.myForm.password.value.indexOf(invalid) > -1) { alert("Sorry, spaces are not allowed."); return false; } else { if (pw1 != pw2) { alert ("You did not enter the same new password twice. Please re-enter your password."); return false; } else { alert('Nice job.'); return true; } } } // End -->

        Enter your password twice.
        (At least 6 characters, 12 characters max, and spaces are not allowed.)

        Password:
        Verify password:

        Free JavaScripts provided
        by The JavaScript Source

        Will the asp code help aswell???

        John Michael Kinsella kinsellajohn@hotmail.com

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups