Jump to content

Search the Community

Showing results for tags 'onsubmit'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hey guys, I added a form to my game, wanting to let the user choose a seed. <form onsubmit="getSeed(event)"> <span>Seed:</span> <input id="seed" type="number" name="seed" value="111" /></form>My structure of my code is like so: module ModuleName { export class World extends Phaser.State { ... create() { ... } getSeed(event) { event.preventDefault(); console.log("submitted"); var seed = document.getElementById('seed')["value"]; ... }}How can I get my function to run, how do I target it? I obviously get an error (ReferenceError: getSeed is not defined) since it can't find my getSeed function. Is it even targetable from outside? Putting "public" infront of the function didn't help, I also tried game.getSeed(), this.game.getSeed(), game.World.getSeed() and a few others to no avail. :/ Also, a bit off topic: Would you take another route than adding an html form?
×
×
  • Create New...