livecode - Login form have some problems -
i beginner in livecode. got code log in. problem want convert password "*" how change following code
local susername, spassword on opencard put "johnsmith" susername put "pa55word" spassword end opencard on logincheck if field "username" susername , field "password" spassword answer "login successful" go card "accessed" else answer "details incorrect. please try again!" end if end logincheck
one simple method use keydown message along custom property store clear text. place following code in password field's script:
on keydown thekey -- restrict allowed keys defined characters if thekey not in "abcdefghijklmnopqrstuvwxyz1234567890" exit keydown put hiddentext of me temp put thekey after temp set hiddentext of me temp put "*" after me end keydown on backspacekey set hiddentext of me empty set text of me empty end backspacekey
the second line in keydown handler lets limit characters accepted password defined list (you include special characters such "#" , "_" , others if wish). backspacekey handler used delete entered characters , start over.
note may want handle special cases such when enterkey and/or returnkeys pressed, trigger submission of form.
Comments
Post a Comment