Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 86

stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
11/13/13 08:29 PM (12 years ago)

For the Javascript and HTML gurus

I know this is not really a BT question so feel free to skip if you're not into Javascript and HTML. I'm trying to do something to an HTML screen on my app to do the following with HTML and Javascript/Jquery Create on screen a text area, say x units across and y units down (though able to expand down if necessary), which has an initial message in the box, say "type text here," then waits for the user to type his text, somehow prompts him to end his typing, and then just saves that text in a variable, say usertext, that I can use later in the rest of my javascript on this page. Thanks. Steve
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/14/13 02:29 AM (12 years ago)
I haven't tried it (although there may be a couple of gurus in the BT Community who have) but I know HTML5 now has some local data storage capability. That should work for you "I think". http://www.w3schools.com/html/html5_webstorage.asp http://html5doctor.com/storing-data-the-simple-html5-way-and-a-few-tricks-you-might-not-have-known/ It can't hurt to look :) Cheers! -- Smug
 
stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
like
11/14/13 09:06 AM (12 years ago)
For those interested, here is a way to do it I found: <!DOCTYPE html> <html> <head> <script> function getText() { var area = document.getElementById("txtArea"); usertext = area.value } </script> </head> <body> <textarea rows="5" cols="5" id = "txtArea"> </textarea> <form> <input type = "button" value="type text here" onclick = "getText();" /> </form> </body> </html>
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
11/14/13 09:56 AM (12 years ago)
Thank you for sharing this, @stevek! I think it is great to blend a discussion of how to use HTML5 into this forum, especially as it relates to apps.
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
11/14/13 03:31 PM (12 years ago)
As Susan says, good share. getting the basics right is always important.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.