Normal Topic Data Input (Read 423 times)
RadioMan
Member
*
Offline



Posts: 1
Joined: Nov 1st, 2006
Data Input
Nov 1st, 2006 at 5:09pm
Print Post Print Post  
In the old days of Q&A data input could be restricted to Lower case, Inital or Upper case.

I may be wrong but it appears that Sesame has Lower or Upper as an option only.

example:   user inputs a name (jones)   Q&A would change this to (Jones) or (jones) or (JONES)
                user inputs a name (jones)   SESAME would change this to (jones) or (JONES)

Does anyone know of a way to set Sesame to default to Initial  (Jones) on data input  please?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Data Input
Reply #1 - Nov 1st, 2006 at 6:08pm
Print Post Print Post  
Paste the code below into the GLOBAL CODE area of your form.

You can then call it to format your value. For example:

MyTitle::On Element Change
MyTitle = MakeTitleCase(MyTitle)


[code]Function MakeTitleCase(vVal as String) As String
var vRet as String
var vChar as String
var vLen as Int
var vLoop as Int
var vSpaceFlag as Int

     vRet = ""
     vLen = @Len(vVal)
     vSpaceFlag = 1
     For vLoop = 1 To vLen
           vChar = @Mid(vVal, vLoop, 1)
           If vChar = " "
           {
                 vSpaceFlag = 1
           }      
           Else
           {
                 If(vSpaceFlag = 1)
                 {
                       vChar = ToUpper(vChar)
                       vSpaceFlag = 0
                 }
                 Else
                 {
                       vChar = ToLower(vChar)
                 }
           }
           vRet = vRet + vChar
     Next
     Return(vRet)      

End Function[/code]
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged