Graphics

 View Only
  • 1.  Limiting text field to numbers

    Posted 08-29-2025 10:55

    In Xpression, is there a way to limit a text field to only accept numbers? I know it can be done with a script, but we were thinking there was a setting somewhere that does that.



    ------------------------------
    Daryl Judd
    Sbgtv
    ------------------------------


  • 2.  RE: Limiting text field to numbers

    Posted 10-29-2025 05:57
    Dim cleanVal As String
    Dim i As Integer
    Dim ch As String
     
    cleanVal = ""
    For i = 1 To Len(text)
        ch = Mid(text, i, 1)
        If ch >= "0" And ch <= "9" Then
            cleanVal = cleanVal & ch
        End If
    Next
    text = cleanVal



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 3.  RE: Limiting text field to numbers

    Posted 10-29-2025 11:00

    Thank you Simon, that does the trick!



    ------------------------------
    Daryl Judd
    Sbgtv
    ------------------------------



  • 4.  RE: Limiting text field to numbers

    Posted 10-29-2025 11:08

    No problem! 



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------