Opened 18 years ago

Closed 18 years ago

#39 closed enhancement (fixed)

Handling a string with only blank space in required fields

Reported by: Martin Svensson Owned by: Martin Svensson
Priority: trivial Milestone: BASE 2.0
Component: web Version:
Keywords: Cc:

Description

When trying to submit a required textfield that just contains blank spaces. There comes an error message about invalid data that perhaps is difficult to understand for the common user. The message is: "Invalid use of null. The 'name' value cannot be set to null."

Perhaps a string with only spaces could be handled in the same way as an empty textfield/string.

Change History (7)

comment:1 by Nicklas Nordborg, 18 years ago

Milestone: BASE 2.0 RC2

comment:2 by Gregory Vincic, 18 years ago

Owner: changed from Gregory Vincic to Nicklas Nordborg

comment:3 by Nicklas Nordborg, 18 years ago

I have added a JavaScript funtion to main library: Main.trimString() which trims a string from leading and trailing spaces.

Use like this:

if (Main.trimString(frm.name.value) == '')
{
   alert("You must enter a name");
   frm.name.focus();
   return false;
}

comment:4 by Nicklas Nordborg, 18 years ago

Milestone: BASE 2.0 RC2BASE 2.0

comment:5 by Martin Svensson, 18 years ago

Owner: changed from Nicklas Nordborg to Martin Svensson
Status: newassigned

comment:6 by Martin Svensson, 18 years ago

(In [2509]) References #39 Handling a string with only blank space in required fields Admin pages updated.

comment:7 by Martin Svensson, 18 years ago

Resolution: fixed
Status: assignedclosed

(In [2511]) Fixes #39 Handling a string with only blank space in required fields. Remaining pages updated.

Note: See TracTickets for help on using tickets.