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

textblock java validation

Options
  • 04-04-2005 5:14pm
    #1
    Registered Users 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 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