Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 15th January 2003, 14:06   #1
Prinz
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!
Prinz is offline   Reply With Quote
Old 15th January 2003, 14:56   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
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
kichik is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump