P5.js: Placeholder in createInput

Created on 24 Oct 2018  路  5Comments  路  Source: processing/p5.js

Nature of issue?

  • [ ] Found a bug
  • [ ] Existing feature enhancement
  • [x] New feature request

Most appropriate sub-area of p5.js?

  • [ ] Color
  • [ ] Core/Environment/Rendering
  • [ ] Data
  • [ ] Events
  • [ ] Image
  • [ ] IO
  • [ ] Math
  • [x] Typography
  • [ ] Utilities
  • [ ] WebGL
  • [ ] Other (specify if possible)

Which platform were you using when you encountered this?

  • [ ] Mobile/Tablet (touch devices)
  • [x] Desktop/Laptop
  • [ ] Others (specify if possible)

Details about the bug:

  • p5.js version: 0.7.2
  • Web browser and version: Chrome 69.0.3497.100, 64-bit
  • Operating System: MacOSX
  • Steps to reproduce this:

New feature details:

I am working on a project where i need to create an input with a placeholder, i.e.
<input type="text" placeholder="X"></input>
However, as far as the internet has told me, there is no way to do this. It would be nice if an argument could be added to the createInput(). Then the syntax could look like:
createInput([value], [placeholder], [type]).

Most helpful comment

one way to do this is:

createInput('value').attribute('placeholder', 'X');

All 5 comments

one way to do this is:

createInput('value').attribute('placeholder', 'X');

Is placeholder a custom attribute or are you trying to do this:

<input type="text" value="placeholder">

Is adding the option of placeholder to the parameters of the createInput method something that needs to be done? Would be happy to add the necessary code/example if needed.

@digitalfrost placeholder is an existing attribute for input type of text (it shows a greyed out placeholder text when the field is empty)

@TanviKumar I think the method suggested by @Spongman is sufficient in this case, for me at least.

@limzykenneth - oh yes html5 - duh !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kjhollen picture kjhollen  路  3Comments

slowizzm picture slowizzm  路  3Comments

ghost picture ghost  路  3Comments

b0nb0n picture b0nb0n  路  3Comments

sps014 picture sps014  路  3Comments