|
|
#1 |
|
Senior Member
|
Again me -
After successfully working with 'RadioButtons' and 'CheckBoxes' on CustomPages, I need some help on 'Type=text' What I am looking for is a description on how the input is written down e.g. code: The value from the 'state' (I take this as default value and as an example for users, if they don't know what they should type) should be written down to a file with the good old search and replace-function. So the 'state' value should replace a placeholder in a ascii-file. The other question is: There must be a value given back, even when the user clears the input. (see attached image). How can this be achieved? Thx in advance Chris |
|
|
|
|
|
#2 | |
|
Major Dude
|
Quote:
PHP Code:
|
|
|
|
|
|
|
#3 |
|
Senior Member
|
I'll give it a try deguix
Thx Chris P.S.: I won't reply for now, because its 1:10 am and I'll go to bed. (Even cigaretts don't make me fit anymore and I feel like ) So tomorrow (or better said in a few hours) I'll give it a try and post the result. |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Mar 2003
Posts: 569
|
In the NSIS Archives there is an article called "Complex validating of InstallOptions user input" which shows how to access data entered by the user.
The article can be found at http://nsis.sourceforge.net/archive/...instances=0,64 If you want to prevent the user from clearing the text box, you could use MinLen and ValidateText in the INI file (see the InstallOptions manual for details). If the user clears all the text, InstallOptions will display a message box containing the text from ValidateText. Last edited by pengyou; 24th March 2003 at 01:30. |
|
|
|
|
|
#5 |
|
Major Dude
|
In this case not Pengyou, he wants to return the default value (the old state of the control) if the user delete the value and click next >.
|
|
|
|
|
|
#6 |
|
Senior Member
|
That's right deguix.
First time the user reaches the CustomPage, several 'default' values are given. The user can accept these values (in this case the 'default' values are given back and written to an ascii-file). If the user enters some other values, the new ones should be written to that file. If the user deletes one (or even more) the default values should be written. Chris |
|
|
|
|
|
#7 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
You don't need to use search & replace, use the MUI_INSTALLOPTIONS_WRITE macro.
|
|
|
|
|
|
#8 |
|
Senior Member
|
Joost -
"Ich verstehe im Moment nur Bahnhof!" So if I get back the value from a "type=text" field how can I replace a default value in an ascii-file? e.g.: -----ascii-file-before---- ....(more lines before)... @@ServerName@@ ....(more lines behind)... ------------------- This is the written down value awaiting a new value given back with "type=text". If the user writes www.acme.tld the result should look like this -----ascii-file-afterwards---- ....(more lines before)... ServerName www.acme.tld ....(more lines behind)... ------------------- Understood what I mean? Chris |
|
|
|
|
|
#9 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Never mind, I thought you were talking about an INI file. Just use the search & replace function
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|