Computer Science Canada Confirm Pass and gui text field help |
Author: | unknowngiver [ Thu May 25, 2006 9:29 pm ] | ||
Post subject: | Confirm Pass and gui text field help | ||
hey after struggling for 2 hours i made this simple form..now i am trying to get it to check if 1. All the fields are Filled in [not empty 2. Password and password confirm equal eachother 3. Email adress has "@something.ext" ending but i cant seem to figure it out help is REALLY REALLY needed appreciated here is the code
Thanks |
Author: | unknowngiver [ Fri May 26, 2006 9:25 am ] |
Post subject: | |
anyone ![]() i struggled till 3 Am last night but still cant get it to work ![]() ![]() help pleasee |
Author: | unknowngiver [ Fri May 26, 2006 10:53 am ] | ||
Post subject: | |||
after 4 hours of struggling i got it to ask the user for the pass thing again if tehy dont equal eachother...but when the form shows up...it has the previous input in it...is there a way of clearing it up? here is my code
Thanks |
Author: | jamonathin [ Fri May 26, 2006 11:06 am ] | ||
Post subject: | |||
Since your code is not runnable, i'll go through each step for ya. 1. If a field is empty, the value of the field will be "". What you can do is run through all of the fields and check if any of them are equal to "". If one is, add it to a list of empty fields, here's an example.
That example simply stores the name if the field so it can be displayed. It can be changed around so that it suits the appropriate name. 2. You need to store the value of the password as he types it (maybe open in a new window so that ONLY that field is being used),then go from there 3. use a for loop with some string manipulation. such as . . [syntax="turing-ish pseudo"] for i: 1 .. length(email) if email(i) = "@" and has not had a "." before then email = ok end if end for[/syntax] Good luck, i'd expand more but i gotta run. |
Author: | unknowngiver [ Fri May 26, 2006 3:59 pm ] |
Post subject: | |
ahan nice code..but if a field is empty..how do i get it to RESTART the form process...so it tells u 2 input something in there... |
Author: | jamonathin [ Fri May 26, 2006 9:02 pm ] |
Post subject: | |
Well what im doing in that code is displaying the empty fields then exiting the loop. What I would do in this situation is open a new window, tell the user which fields are empty then return to the main screen. Take a quick look at this program, its not source code but it's what im talking about. http://compsci.ca/v2/viewtopic.php?t=11996 |
Author: | jamonathin [ Fri May 26, 2006 9:05 pm ] |
Post subject: | |
What i also ment to add in was just go File -> Save, it'll show exactly what I mean. |
Author: | unknowngiver [ Mon May 29, 2006 9:27 am ] |
Post subject: | |
i still dont get it :'( can anyone please add me on msn and help me out |
Author: | MysticVegeta [ Mon May 29, 2006 9:42 am ] |
Post subject: | |
unknowngiver wrote: ahan
nice code..but if a field is empty..how do i get it to RESTART the form process...so it tells u 2 input something in there... ok, you see jamonathin's code right? its pretty excellent code, to deactivate the exiting of the "form process", just remove the "GUI.Quit" from the doneProc... it should make logical sense eh? |
Author: | unknowngiver [ Mon May 29, 2006 10:56 am ] |
Post subject: | |
yaiii it worked ![]() Now I need to make them blank after the registration..because if they click the REGISTER button again...the page has all the stuff that they had before [its not clearing it..] |
Author: | MysticVegeta [ Mon May 29, 2006 1:03 pm ] | ||
Post subject: | |||
F10 and
Look that up it has 2 args, (widgetID : int, text : string) the widgetID is the widget id duh. and the text would be "" (empty string) to blank-en (?) them. |