Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

textblock java validation

  • 04-04-2005 4:14pm
    #1
    Registered Users, Registered Users 2 Posts: 1,997 ✭✭✭


    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