pgoe88

NoNopoly_InputNames

Mar 24th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. renderContentOn: html
  2. "Form to enter the player's names. Checks if the input doesn't include any spaces or if the name already exists."
  3.  
  4. self fehlerMeldung:''.
  5.  
  6. html div class: 'formular'; with:
  7. [html form: [html strong: 'Bitte Spieler-Namen eingeben:'.
  8. 1 to: self anzahlSpieler do:
  9.     [:i | html div with: [
  10.         "Already entered names will be shown"
  11.         html textInput value: (self nameAn: i);
  12.         callback: [:sSpielerName | (self namen at: i put: (sSpielerName))]]].
  13.         (html submitButton) text: 'Spieler anlegen';
  14.         "Checks if the input is correct"
  15.          callback: [(self spielerEingabeGueltig)
  16.             ifTrue: [self answer: namen]
  17.             ifFalse: [self inform: self fehlerMeldung]]].
  18.     ].
Advertisement
Add Comment
Please, Sign In to add comment