quick question - if you have a rectangle, and define it this way:
<input type="text" id="first_name" placeholder="" style="padding-left: 2px; line-height: 24px; font-size: 1.24em; width: 100%; border: none; font-family: Lobster Two; color:#1B5A57; background-color:#FFFEE1">
it renders out to the browser as a lovely bit of text that you can easily select and edit. however, when you change the value of the field, and try to pass this to a variable, such as:
first_name = hypeDocument.getElementById(‘first_name’).innerHTML;
this renders undefined.
in this scenario - if you console log this:
console.log(hypeDocument.getElementById(‘first_name’).innerHTML);
you get this:
<input type="text" id="first_name" style="padding-left: 2px; line-height: 24px; font-size: 1.24em; width: 100%; border: none; font-family: Lobster Two; color:#1B5A57; background-color:#FFFEE1">
which makes perfect sense. however, if you have added or changed text to that field, then are seeking the newer / edited value, how to get at the new value is slightly confusing me. this:
console.log(hypeDocument.getElementById(‘first_name’).value);
is undefined
I have also tried the following method, which worked really well in terms of the data being correct, but for some reason when I click on the fields they do not go into edit mode right away, i have to tab into the field before I can add or remove text. not ideal.
on the rectangle that is the shape, on the class, use editable - and add this to the code initiated when the scene loads:
var editables = document.querySelectorAll(’.editable’);
console.log(editables);
for (var i=0; i < editables.length; i++) {
editables[i].contentEditable = "true";
}
I will read anything that can help - I would like very much to make this work and I am super close. I have downloaded and reviewed all the examples of forms, but I am missing something. the crux of the matter is either:
- how do use a rectangle with the input text type and HTML code that makes it work well and look good, but somehow get that data out in a clean way
or
- how do i use the .editable way, but somehow make it where i can just click once inside the item and start typing as per typical expectation of user interface design, rather than having to tab through to be able to start typing in the fields?
and this is neither here nor there, but when I use the setup that makes me tab before I can type, i even have to click a non text object above the first field on the layout so i can tab into the field, its so bizarre.