Jump to content

Help for RPG Custom Character Sheet


Recommended Posts

Good Day,

I am a VERY beginner in HTML/Javascript programming, but I am trying to create a custom RPG character sheet for personal use with my friends in HTML file.

After several weeks of work, the sheet is complete, and I included several javascript to create automatic calculations. Only 2 points I am missing to be perfect:

a)in the sheet there are several DETAILS tags with SUMMARY that includes an input field for the user. Now, every time the user is editing the field and the space button is pressed, the DETAILS section is opened. There is a way to prevent this and limit the pressing of space key to only add a space in the text? I know that probably I should use keydown event but I cannot find any correct way to do so. Here is what I did, but this is preventing also the actual space to be inserted in the field:

addEventListener('keydown', function(e) {
  if(e.keyCode === 32) {

b)I would like to create a button that once pressed will open the "Save as" dialog so the user can click there instead of opening the browser menu. Any suggestion in this is also appreciated.

Sorry again for the (probably) stupid questions (and for the English) but as I said, I am a complete beginner in this, so any help from experts is really appreciated.

By the way, W3 is helping me A LOT with the examples, great repository of information!

Edited by Pietro
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...