Old 23rd May 2011, 05:48   #1
lloydtech
Junior Member
 
Join Date: Mar 2011
Posts: 20
Check if a textbox is empty

Hi,

How can we check a text box is empty or not? There is a Custom Page settings dialog in my wizard. In that I want to check whether a text box is empty or not. This is the code I have written, but by default "$MySQLHostNameHandle" contains some junk value!

code:


Var MySQLHostNameHandle

Function PageSettings
${NSD_CreateText} 25u 73u 100u 15u "$MySQLHostName"
Pop $MySQLHostNameHandle
strcmp $MySQLHostNameHandle "" ER33 OK33
ER33:
${NSD_SetText} $MySQLHostNameHandle "localhost"
OK33:
FunctionEnd



The intention of this code is, When the dialog is created for the first time, it has to fill the text box with "localhost", but if the user changes the textbox data, and he clicks "next" and "back", the text box has to contain the user supplied data than the default data..


How can I do this?

Thanks
Lloyd
lloydtech is offline   Reply With Quote
Old 23rd May 2011, 06:15   #2
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
Use a variable as the default value of the text box. Set the default value of this variable to "localhost" by StrCpy. Set the content of the text box to the variable when leaving the page or in event function (using ${NSD_OnChange}).

Contact me: 137729898@qq.com
jiake is offline   Reply With Quote
Old 23rd May 2011, 08:12   #3
lloydtech
Junior Member
 
Join Date: Mar 2011
Posts: 20
Thanks, it worked...
lloydtech 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