Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Convalida input singolo apice

  • antonellacap
  • antonellacap's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208861 by antonellacap
Convalida input singolo apice was created by antonellacap
Ciao a tutti,
Ho un problema con una convalida di input di un campo di tipo testo breve.
In pratica vorrei che nel campo testo siano accettati solo caratteri maiuscoli,punti, trattini e apici (apostrofi).
Ho inserito la seguente espressione regolare ma quando inserisco l'apice non mi riconosce il carattere:
/^[A-Z.'- ]+$/.
Ho anche inserito la negazione tutto ad eccezione di caratteri minuscoli, ma niente.

/[^a-z]+$/

Qualcuno può aiutarmi?
Uso la versione 4.3

Grazie
The topic has been locked.
  • antonellacap
  • antonellacap's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208959 by antonellacap
Replied by antonellacap on topic Convalida input singolo apice
Qualcuno può aiutarmi?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208965 by Joffm
Replied by Joffm on topic Convalida input singolo apice
Buongiorno,

È necessario mascherare il punto e l'apostrofo

regexMatch("/^[A-Z\'\.-]+$/",self)







Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: antonellacap, venkman
The topic has been locked.
  • antonellacap
  • antonellacap's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #208987 by antonellacap
Replied by antonellacap on topic Convalida input singolo apice
Grazie mille
The topic has been locked.
More
3 years 3 weeks ago - 3 years 3 weeks ago #214221 by venkman
Replied by venkman on topic Convalida input singolo apice

/^[A-Z.'- ]+$/.


 
Buongiorno a tutti,

Non riesco a mettere l'espressione giusta se voglio solo maiuscole e numeri (parliamo di inserimento del codice fiscale)

regexMatch("/^[A-Z\1-9]+$/",self)

no, eh?

Grazie

LimeSurvey Versione 6.2.0+230732

"In queste occasioni io sono semplicemente me stesso e questo ha sempre funzionato alla grande. Consiglio quindi a tutti di fare lo stesso: siate me stesso."


fabio dot devercelli at comune dot preganziol dot tv dot it
Last edit: 3 years 3 weeks ago by venkman.
The topic has been locked.
More
3 years 3 weeks ago #214253 by lfanfoni
Replied by lfanfoni on topic Convalida input singolo apice
Con una ricerca su google ho trovato questa:
^[A-Z]{6}[0-9]{2}[A-Z][0-9]{2}[A-Z][0-9]{3}[A-Z]$
Provala nella "Convalida" di domanda, e se ti funziona, la metti nella equazione di convalida:
regexMatch("^[A-Z]{6}[0-9]{2}[A-Z][0-9]{2}[A-Z][0-9]{3}[A-Z]$",self.NAOK)
Il .NAOK conviene metterlo sempre.
Se cerchi un po' dovresti trovare anche qualcosa di più sofisticato

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The following user(s) said Thank You: venkman
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 weeks ago #214267 by Joffm
Replied by Joffm on topic Convalida input singolo apice

dovresti trovare anche qualcosa di più sofisticato



regexMatch("/^[A-DF-HJ-NP-TV-Z]{6}[0-9]{2}[A-EHLMPRST]([04][1-9])|([1-25-6][0-9])|([37][01])[A-Z][0-9]{3}[A-Z]$/",self.NAOK)

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: lfanfoni, venkman
The topic has been locked.
More
2 years 10 months ago #216571 by lalle100
Replied by lalle100 on topic Convalida input singolo apice
Ciao,
intanto ti ringrazio per il suggerimento. Io non sono esperta di regular expression e sto andando un po' per tentativi.
Se puoi ho due domande.
1) Vorrei fare machare il codice fiscale sia con maiuscole che minuscole perchè non voglio che gli utenti impazziscano. Ho provato
/^[A-Za-z]{6}[0-9]{2}[A-Za-z][0-9]{2}[A-Za-z][0-9]{3}[A-Za-z]$/, ma non mi funziona. Qualche idea?
2)Ho anche provato a mettere nella equazione di convalida:
regexMatch("^[A-Z]{6}[0-9]{2}[A-Z][0-9]{2}[A-Z][0-9]{3}[A-Z]$",self.NAOK)
ma non mi funziona.
Grazie
Ale
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 10 months ago #216573 by Joffm
Replied by Joffm on topic Convalida input singolo apice
Non vedo (quasi) alcun problema.
1.
 
   

   


2. La "/" manca qui. Ma funziona anche questo.
 
   

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose