Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

textblock java validation

  • 04-04-2005 05:14PM
    #1
    Registered Users, Registered Users 2 Posts: 1,999 ✭✭✭


    I have a .jsp page with a textblock and I want to validate that block so it only contains alphanumeric characters plus spaces and also the carriage return(multilines).

    Is it possible to convert the textblock into a String? I also have regular textboxes and that was no problem I'm just wondering if the return key will effect it at all?

    How would I go about validating the carriage return. At the moment i have the textblock being made into a String and I'm using an array of chars to check each character to see if it is alphanumeric or a space. Is there a unicode character for hitting return or whatever it's called. I've tried a few things and I'm not getting it working

    Or am I going about this arseways as usual :rolleyes:

    Thanks for your help :)


Comments

  • Registered Users, Registered Users 2 Posts: 261 ✭✭HaVoC


    System.getProperty("line.separator"); should return a string with the newline char in it.


  • Closed Accounts Posts: 1,502 ✭✭✭MrPinK


    How would I go about validating the carriage return. At the moment i have the textblock being made into a String and I'm using an array of chars to check each character to see if it is alphanumeric or a space. Is there a unicode character for hitting return or whatever it's called.
    Check for '\n' (newline) and '\r' (return).


Advertisement