Jump to content

Pietro

Members
  • Posts

    1
  • Joined

  • Last visited

Pietro's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. 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) { e.preventDefault(); } }); 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!
×
×
  • Create New...