Jump to content
Sign in to follow this  
Ruigerock

Inputbox question

Recommended Posts

Ruigerock

Hello people,

I'm trying to make an inputbox (simple question) with a minimum length of 17 characters.

They have to fill in their e-mail address which in our company the smallest one is 17 characters.

Help Topics all refer to the password field:

The second and subsequent characters of the password field can be used to restrict input. Use a space to fill the first character to still see the characters typed. Putting an M after the first character indicates that input is Mandatory; i.e. you must enter something. Nothing will happen if you press the Ok button when there is nothing in the InputBox. It will not close and return the string.

You can also specify the maximum length in the end of the password field. Just enter a number as the last character to specify the length of the string.

You can specify if it is mandatory and you can specify a maximum length, but not a minimum.

Anyone ideas for inputbox or a different procedure?

Greetings

Rick

Share this post


Link to post
Share on other sites
DW1

you could do a check after, or better yet just use a small gui and make the "OK" button greyed out until the user puts at least 17 characters in the field with StringLen().

Share this post


Link to post
Share on other sites
Ruigerock

you could do a check after, or better yet just use a small gui and make the "OK" button greyed out until the user puts at least 17 characters in the field with StringLen().

It sounds like a good idea to use a greyed out "OK" button, do you also know the GUI control name?

Or would you like to post me a small example script?

Share this post


Link to post
Share on other sites
DW1

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Input_1 = GuiCtrlCreateInput("Input1", 40, 110, 300, 20)
$Button_2 = GuiCtrlCreateButton("Button2", 60, 160, 260, 90)
$Label_3 = GuiCtrlCreateLabel("You Must Have 10 Characters to hit 'OK'", 90, 40, 220, 40)
GUICtrlSetState( $Button_2, $GUI_DISABLE )
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
        If StringLen(GUICtrlRead( $Input_1 )) > 9 and GUICtrlGetState( $Button_2 ) = 144 Then GUICtrlSetState( $Button_2, $GUI_ENABLE )
        If StringLen(GUICtrlRead( $Input_1 )) < 10 and GUICtrlGetState( $Button_2 ) = 80 Then GUICtrlSetState( $Button_2, $GUI_DISABLE )
        Sleep(10)
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites
Ruigerock

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Input_1 = GuiCtrlCreateInput("Input1", 40, 110, 300, 20)
$Button_2 = GuiCtrlCreateButton("Button2", 60, 160, 260, 90)
$Label_3 = GuiCtrlCreateLabel("You Must Have 10 Characters to hit 'OK'", 90, 40, 220, 40)
GUICtrlSetState( $Button_2, $GUI_DISABLE )
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
        If StringLen(GUICtrlRead( $Input_1 )) > 9 and GUICtrlGetState( $Button_2 ) = 144 Then GUICtrlSetState( $Button_2, $GUI_ENABLE )
        If StringLen(GUICtrlRead( $Input_1 )) < 10 and GUICtrlGetState( $Button_2 ) = 80 Then GUICtrlSetState( $Button_2, $GUI_DISABLE )
        Sleep(10)
    EndSelect
WEnd
ExitoÝ÷ Ûú®¢×©äʯz¼¦¹È]j|"X·Ý.®Ç+pjËazØb°jÉh¢H§ú+Ùh¢K&¢·ªºi®®¢ÙèÁ«­¢+Ø¥¹±Õ±ÐíÕ¥
½¹ÍѹÑ̹ÔÌÐì)Õ¥
ÉÑ ÅÕ½ÐíY¥Í¥½¹Á±¹¹È%¹Íѱ±Ñ¥ÅÕ½Ðì°ÐÀÔ°ÄØа´Ä°´Ä° ¥Ñ=H ÀÌØí]M}=YI1AA]%9=°ÀÌØí]M}
1%AM%   1%9L¤¤((ÀÌØí%¹ÁÕÑ|ÄôÕ¥
Ñɱ
ÉÑ%¹ÁÕÐ ÅÕ½ÐíY@ÅÕ½Ðì°ÄÀ°ÐÀ°ÌäÀ°ÈÀ¤(ÀÌØí%¹ÁÕÑ|ÈôÕ¥
Ñɱ
ÉÑ%¹ÁÕÐ ÀÌØíµ¥±ÉÍÌ°ÄÀ°äÀ°ÌäÀ°ÈÀ¤(ÀÌØí1±|ÌôÕ¥
Ñɱ
ÉÑ1° ÅÕ½Ðí]Х̩½Õܱ¥¹Ñ¥¹ÕµµÈ ä­É­ÑÉ̤ü¹µ±¥Ñ¡±¸¥¨%PÅÕ½Ðì°ÄÀ°ÄÀ°ÌÜÀ°ÈÀ¤(ÀÌØí1±|ÐôÕ¥
Ñɱ
ÉÑ1° ÅÕ½Ðí]Х̩½ÕÜÙ½±±¥µµ¥°ÉÌüÅÕ½Ðì°ÄÀ°ÜÀ°ÐÀÀ°ÈÀ¤(ÀÌØí    ÕÑѽ¹|ÔôÕ¥
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐíMÑÉÐY¥Í¥½¹Á±¹¹ÈÅÕ½Ðì°ÄÌÀ°ÄÈÀ°ÄÔÀ°ÌÀ¤()U%
ÑɱMÑMÑÑ ÀÌØí ÕÑѽ¹|Ô°ÀÌØíU%}%M    1¤)Õ¥MÑMÑÑ ¤()]¡¥±Ä($ÀÌØíµÍôÕ¥Ñ5Í ¤(%M±Ð(%
ÍÀÌØíµÍôÀÌØíU%}Y9Q}
1=M($%á¥Ñ1½½À(%
ÍÀÌØíµÍôÀÌØí    ÕÑѽ¹|Ô($$í¥¹Íѱ°ÍÉ¥ÁеäÔÍɽÉÈ($%á¥Ð(%
ͱÍ(%MÑÉ¥¹1¸¡U%
ÑɱI ÀÌØí%¹ÁÕÑ|Ĥ¤ôä¹U%
ÑɱÑMÑÑ ÀÌØí  ÕÑѽ¹|Ô¤ôÄÐÐQ¡¸U%
ÑɱMÑMÑÑ ÀÌØí ÕÑѽ¹|Ô°ÀÌØíU%}9 1¤(%MÑÉ¥¹1¸¡U%
ÑɱI ÀÌØí%¹ÁÕÑ|Ĥ¤±Ðìä¹U%
ÑɱÑMÑÑ ÀÌØí  ÕÑѽ¹|Ô¤ôàÀQ¡¸U%
ÑɱMÑMÑÑ ÀÌØí ÕÑѽ¹|Ô°ÀÌØíU%}%M    1¤(%MÑÉ¥¹1¸¡U%
ÑɱI ÀÌØí%¹ÁÕÑ|Ĥ¤Ðìä¹U%
ÑɱÑMÑÑ ÀÌØí  ÕÑѽ¹|Ô¤ôàÀQ¡¸U%
ÑɱMÑMÑÑ ÀÌØí ÕÑѽ¹|Ô°ÀÌØíU%}%M    1¤(M±À ÄÀ¤(%¹M±Ð)]¹)á¥

Now the script needs exactly 9 characters in the licensenumber field.

I extracted the e-mail address using a active directory script.

Greetings

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×