|
|
#1 |
|
Junior Member
Join Date: Jan 2003
Location: The Netherlands
Posts: 24
|
Can't cancel a field validation
Hi,
I have the following code in a custom page. the meaning of this code is that the user has to fill in a value in at least 1 of the 2 textboxes. When pressing cancel, the field validation goes on and the "wrong" error message appears. Is there a way to press cancel without getting the error message if nothing has been filled in? dialog: InstallOptions::dialog "$PLUGINSDIR\ioC.ini" ReadIniStr $5 $PLUGINSDIR\ioC.ini "Field 1" STATE ReadIniStr $6 $PLUGINSDIR\ioC.ini "Field 2" STATE StrCmp $6 "" next continue next: StrCmp $5 "" wrong end wrong: MessageBox MB_OK|MB_ICONINFORMATION "Please fill in at lease 1 of the 2 textfields!" Goto dialog continue: StrLen $3 $6 StrLen $4 $5 IntCmp $3 5 next1 wrong next1: IntCmp $4 0 end wrong wrong end: Greets! |
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Compare the result of IO to "success", only then validate the text because that's when the user clicked next. Just like in this example: http://nsis.sourceforge.net/archive/....php?pageid=87
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|