Discussions
Categories
- 196.7K All Categories
- 2.2K Data
- 235 Big Data Appliance
- 1.9K Data Science
- 449.8K Databases
- 221.6K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 549 MySQL Community Space
- 477 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 532 SQLcl
- 4K SQL Developer Data Modeler
- 186.9K SQL & PL/SQL
- 21.3K SQL Developer
- 295.4K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.1K Development Tools
- 104 DevOps
- 3.1K QA/Testing
- 645.9K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 153 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 17 Java Essentials
- 158 Java 8 Questions
- 85.9K Java Programming
- 79 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.2K Java SE
- 13.8K Java Security
- 203 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 395 LiveLabs
- 37 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.6K Other Languages
- 2.3K Chinese
- 170 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 230 Portuguese
Get the value of an element

801863
Member Posts: 14
Hi everybody,
I have the following two objects in a JavaScript function:
TITLE: Auto Body and Paint --> "Auto Body and Paint": is the value
35 characters left --> "35" is the value
I try to get the values as following:
Title: found: undefined
Left: found: undefined
How can I get the real values? Any help is gretly apprecaited.
I have the following two objects in a JavaScript function:
var title = document.createElement("div"); title.id="titleDiv_" + creativeList[0].id; title.style.marginTop="15px"; var left = document.createElement("div"); left.id="left"; left.innerHTML = "<input readonly id=\"left1\" type=\"text\" name=\"inputLeft\" size=3 maxlength=3 value=\"35\"><font>characters left</font>"; title.innerHTML = "TITLE:   <input maxlength=\"" + <c:out value="${titleMaxSize}"/> + "\" size=\"" + <c:out value="${titleMaxSize}"/> + "\" type=\"text\" id=\"title_" + creativeList[0].id + "\" name=\"inputTitle\" value=\"" + creativeList[0].title + "\">";On the website, I see the fields with the "values" as follows; meaning it does show the values:
TITLE: Auto Body and Paint --> "Auto Body and Paint": is the value
35 characters left --> "35" is the value
I try to get the values as following:
if(document.getElementById("title_" + creativeList[0].id).value.length == 0) { alert("Title: nothing"); }else{ alert("Title: found: " + ("title_" + creativeList[0].id).value); } if(document.getElementById('left1').value.length == 0) { alert("Left: nothing"); }else{ alert("Left: found: " + ('left1').value); }I don't receive any error, however, this is what I get:
Title: found: undefined
Left: found: undefined
How can I get the real values? Any help is gretly apprecaited.
Answers
-
And this has what to do with Java exactly?
-
Please let me know if you know of any good related forum. Sorry was not able to find any
-
Javascript? I recommend the HTML and Javascript forum at CodeRanch.com: http://www.coderanch.com/forums/f-20/HTML-JavaScript.
This discussion has been closed.