Old 7th June 2007, 00:04   #1
carleton
Junior Member
 
Join Date: Jun 2007
Posts: 2
Question custom page and validate the input

I am working on developing a custom page that needs to validate the input before continuing. I have read the OptionInstall2 page a number of times now and simply do not understand how to get the validation function called. Here is what I have:

Here is my init:
code:

Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "assets\RegForm.ini" "RegForm"
FunctionEnd



This is where I am calling the page:
code:

!insertmacro MUI_PAGE_LICENSE "..\licence\Licence.txt"

LangString REGFORM_TITLE ${LANG_ENGLISH} "Registration."
LangString REGFORM_SUBTITLE ${LANG_ENGLISH} "Enter your Unlock Key."
Page custom RegPageShow

!insertmacro MUI_PAGE_DIRECTORY



The function calls:
code:

Function RegPageShow

!insertmacro MUI_HEADER_TEXT "$(REGFORM_TITLE)" "$(REGFORM_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "RegForm"

FunctionEnd

Function RegPageValidate

ReadINIStr $R0 "RegistrationForm" "Field 4" "State"
StrCmp $R0 "" 0 +3
MessageBox MB_ICONEXCLAMATION|MB_OK "Please enter your name."
Abort

FunctionEnd

carleton is offline   Reply With Quote
Old 7th June 2007, 03:28   #2
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
I see your function called RegPageValidate, but when is it executed?
Try move the contents of RegPageValidate into RegPageShow...


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 7th June 2007, 05:50   #3
demiller9
Senior Member
 
Join Date: Mar 2006
Location: Dallas
Posts: 462
put the validation function on the custom page definition
code:
Page custom RegPageShow RegPageValidate

Don
demiller9 is offline   Reply With Quote
Old 7th June 2007, 22:45   #4
carleton
Junior Member
 
Join Date: Jun 2007
Posts: 2
Quote:
Originally posted by demiller9
put the validation function on the custom page definition
Thank you! I did keep digging through the documentation last night and finally found the answer, I am still a bit new to working with Open Source project's, man what a different mindset. The answer is there, you just have to dig for it at times!
carleton is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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