I can't find in coinche example (of course, there's not in this game!) and in the documentation how to use forms?
How to make a form with a text field?
How to retrieve the text entered by the user?
Thanks for your help.
Post by Victoria_La »
Forms not corps: sorry! Automatic spellcheckingVictoria_La wrote: ↑19 January 2024, 01:12 Are you player or developer? Have no idea what is corps... And if you cannot google "how to make form with a text field in html" you cannot move forward with development here...
Code: Select all
{FORMINPUT}
Code: Select all
$this->tpl['FORMINPUT'] = ??? ;
Code: Select all
<input type="text"...
Why not just include the HTML in the tpl file? Unless of course it's not always on the page (which I assume it isn't), in which case you enter it dynamically in Javascript, either using the "JS template" blocks explained in the docs (https://en.doc.boardgamearena.com/Game_ ... _templates), or just directly using normal Javascript DOM methods.Fred504 wrote: ↑19 January 2024, 15:35 In X.view.php, I have to setShould I put the HTML code likeCode: Select all
$this->tpl['FORMINPUT'] = ??? ;Code: Select all
<input type="text"...
No, once a game is started the user interacts with the server via Ajax requests, not standard GET and POST requests. You probably want to add your own "submit" button and add an event listener to that to get the entered data and then do whatever you want with it.How should I get the entered data?
With $_POST?
Code: Select all
$this->tpl['FORMINPUT'] = ??? Post by Jonathan2004 »
What makes you think you have to do anything like that?Fred504 wrote: ↑22 January 2024, 15:11 So, to say this is a form with input text, what should I write inWhat should I write to get text that thé player writes on thé form?Code: Select all
$this->tpl['FORMINPUT'] = ???
I can't find any explanation or example.
Code: Select all
$this->tplI can't find the BGA codes of Decrypto and Just one on github.Jonathan2004 wrote: ↑22 January 2024, 17:42 According to all your questions on the forum, you may have not read all the studio docs, which the entry is https://en.doc.boardgamearena.com/Studi ... I_start.3F.
And at least you should read AND code one of the tutorial.
Then you will see that every interactions from Client to Server is bound to asynchronous actions, so let's see the related page
The majority of games don't use text inputs, so you can check yourself the client code of those games (Concept, or Just One for example)
PS : It could be a good idea to play some games on BGA too, in order to get the idea of the players expectations.