The specified value “undefined” is not a valid numberValidate decimal numbers in JavaScript - IsNumeric()Detecting an undefined object propertyHow to validate an email address in JavaScript?Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?How to check empty/undefined/null string in JavaScript?How can I get query string values in JavaScript?How to determine if variable is 'undefined' or 'null'?How to check for “undefined” in JavaScript?Can I hide the HTML5 number input’s spin box?Is there a standard function to check for null, undefined, or blank variables in JavaScript?
Using chord iii in a chord progression (major key)
What color to choose as "danger" if the main color of my app is red
Why commonly or frequently used fonts sizes are even numbers like 10px, 12px, 16px, 24px, or 32px?
Break long word (not long text!) in longtable cell
Network latencies between opposite ends of the Earth
Are there microwaves to heat baby food at Brussels airport?
Is my test coverage up to snuff?
Why would someone open a Netflix account using my Gmail address?
What is this weird d12 for?
c++ conditional uni-directional iterator
Could a space colony 1g from the sun work?
Were any toxic metals used in the International Space Station?
Could there be something like aerobatic smoke trails in the vacuum of space?
Understanding Deutch's Algorithm
Why were the bells ignored in S8E5?
How to check if comma list is empty?
Would life always name the light from their sun "white"
tikzcd diagram within an array
Why is the marginal distribution/marginal probability described as "marginal"?
Why did Varys remove his rings?
Is there an academic word that means "to split hairs over"?
What do the "optional" resistor and capacitor do in this circuit?
Wireless headphones interfere with Wi-Fi signal on laptop
Why do galaxies collide?
The specified value “undefined” is not a valid number
Validate decimal numbers in JavaScript - IsNumeric()Detecting an undefined object propertyHow to validate an email address in JavaScript?Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?How to check empty/undefined/null string in JavaScript?How can I get query string values in JavaScript?How to determine if variable is 'undefined' or 'null'?How to check for “undefined” in JavaScript?Can I hide the HTML5 number input’s spin box?Is there a standard function to check for null, undefined, or blank variables in JavaScript?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I´m learning for an exam which is about company inventories.
I thought i could do myself a favor and learn something new about coding while learning for this exams.
Normally i only do frontend with very little javascript at my company.
What i´m trying to do is setting up a table with 2 input rows.
Row 1: Input from me
Row 2: Sums of my input
i put in a button that should give the value i enter at Row 1 to another field in Row 2.
When my input type is number im getting this:
The specified value "undefined" is not a valid number. The value must match to the following regular expression: -?(d+|d+.d+|.d+)([eE][-+]?d+)?
When my input type is text im getting:
undefined
I´m pretty sure something about my function is wrong but i can´t figure it out and when i search for my issue i only find more complex cases which i also
don´t understand.
Thank´s in advance for any help :)
<script>
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
</script>
</head>
<body>
<table>
<tr><td><b><button onclick="test()">test</button></b></td></tr>
<tr><td> </td></tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names--><!--Names-->
<caption>A: Vermögen</caption>
<tr><th>I. Anlagevermögen</th></tr>
<tr><td class="first">Grundstücke</td></tr>
<tr><td class="second">Gernotstraße</td> </tr>
</table>
<table id="input">
<!--Input--><!--Input-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><form id="1"><input type="number" value="0"></form></td></tr>
</table>
<table id="values">
<!--Values--><!--Values-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><input id="ro" type="number"value="0" readonly></td></tr>
</table>
</div>
</td>
</tr>
</table>
javascript html5 input datatable getelementbyid
add a comment |
I´m learning for an exam which is about company inventories.
I thought i could do myself a favor and learn something new about coding while learning for this exams.
Normally i only do frontend with very little javascript at my company.
What i´m trying to do is setting up a table with 2 input rows.
Row 1: Input from me
Row 2: Sums of my input
i put in a button that should give the value i enter at Row 1 to another field in Row 2.
When my input type is number im getting this:
The specified value "undefined" is not a valid number. The value must match to the following regular expression: -?(d+|d+.d+|.d+)([eE][-+]?d+)?
When my input type is text im getting:
undefined
I´m pretty sure something about my function is wrong but i can´t figure it out and when i search for my issue i only find more complex cases which i also
don´t understand.
Thank´s in advance for any help :)
<script>
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
</script>
</head>
<body>
<table>
<tr><td><b><button onclick="test()">test</button></b></td></tr>
<tr><td> </td></tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names--><!--Names-->
<caption>A: Vermögen</caption>
<tr><th>I. Anlagevermögen</th></tr>
<tr><td class="first">Grundstücke</td></tr>
<tr><td class="second">Gernotstraße</td> </tr>
</table>
<table id="input">
<!--Input--><!--Input-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><form id="1"><input type="number" value="0"></form></td></tr>
</table>
<table id="values">
<!--Values--><!--Values-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><input id="ro" type="number"value="0" readonly></td></tr>
</table>
</div>
</td>
</tr>
</table>
javascript html5 input datatable getelementbyid
2
Your id must be assigned to a input element, not the form itself.
– Marc
Mar 23 at 15:38
oh i see that was stupid, it works now. Thank you very much!
– Jurijcorn
Mar 23 at 15:44
add a comment |
I´m learning for an exam which is about company inventories.
I thought i could do myself a favor and learn something new about coding while learning for this exams.
Normally i only do frontend with very little javascript at my company.
What i´m trying to do is setting up a table with 2 input rows.
Row 1: Input from me
Row 2: Sums of my input
i put in a button that should give the value i enter at Row 1 to another field in Row 2.
When my input type is number im getting this:
The specified value "undefined" is not a valid number. The value must match to the following regular expression: -?(d+|d+.d+|.d+)([eE][-+]?d+)?
When my input type is text im getting:
undefined
I´m pretty sure something about my function is wrong but i can´t figure it out and when i search for my issue i only find more complex cases which i also
don´t understand.
Thank´s in advance for any help :)
<script>
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
</script>
</head>
<body>
<table>
<tr><td><b><button onclick="test()">test</button></b></td></tr>
<tr><td> </td></tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names--><!--Names-->
<caption>A: Vermögen</caption>
<tr><th>I. Anlagevermögen</th></tr>
<tr><td class="first">Grundstücke</td></tr>
<tr><td class="second">Gernotstraße</td> </tr>
</table>
<table id="input">
<!--Input--><!--Input-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><form id="1"><input type="number" value="0"></form></td></tr>
</table>
<table id="values">
<!--Values--><!--Values-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><input id="ro" type="number"value="0" readonly></td></tr>
</table>
</div>
</td>
</tr>
</table>
javascript html5 input datatable getelementbyid
I´m learning for an exam which is about company inventories.
I thought i could do myself a favor and learn something new about coding while learning for this exams.
Normally i only do frontend with very little javascript at my company.
What i´m trying to do is setting up a table with 2 input rows.
Row 1: Input from me
Row 2: Sums of my input
i put in a button that should give the value i enter at Row 1 to another field in Row 2.
When my input type is number im getting this:
The specified value "undefined" is not a valid number. The value must match to the following regular expression: -?(d+|d+.d+|.d+)([eE][-+]?d+)?
When my input type is text im getting:
undefined
I´m pretty sure something about my function is wrong but i can´t figure it out and when i search for my issue i only find more complex cases which i also
don´t understand.
Thank´s in advance for any help :)
<script>
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
</script>
</head>
<body>
<table>
<tr><td><b><button onclick="test()">test</button></b></td></tr>
<tr><td> </td></tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names--><!--Names-->
<caption>A: Vermögen</caption>
<tr><th>I. Anlagevermögen</th></tr>
<tr><td class="first">Grundstücke</td></tr>
<tr><td class="second">Gernotstraße</td> </tr>
</table>
<table id="input">
<!--Input--><!--Input-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><form id="1"><input type="number" value="0"></form></td></tr>
</table>
<table id="values">
<!--Values--><!--Values-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><input id="ro" type="number"value="0" readonly></td></tr>
</table>
</div>
</td>
</tr>
</table>
javascript html5 input datatable getelementbyid
javascript html5 input datatable getelementbyid
asked Mar 23 at 15:34
JurijcornJurijcorn
277
277
2
Your id must be assigned to a input element, not the form itself.
– Marc
Mar 23 at 15:38
oh i see that was stupid, it works now. Thank you very much!
– Jurijcorn
Mar 23 at 15:44
add a comment |
2
Your id must be assigned to a input element, not the form itself.
– Marc
Mar 23 at 15:38
oh i see that was stupid, it works now. Thank you very much!
– Jurijcorn
Mar 23 at 15:44
2
2
Your id must be assigned to a input element, not the form itself.
– Marc
Mar 23 at 15:38
Your id must be assigned to a input element, not the form itself.
– Marc
Mar 23 at 15:38
oh i see that was stupid, it works now. Thank you very much!
– Jurijcorn
Mar 23 at 15:44
oh i see that was stupid, it works now. Thank you very much!
– Jurijcorn
Mar 23 at 15:44
add a comment |
3 Answers
3
active
oldest
votes
Mistake
- First thing
id
is not only numeric. so you must mix with some string - And
document.getElementById("string1")
is placed withform
not a input.so add id to input instead ofform
<script>
function test()
var x = document.getElementById("string1").value;
document.getElementById("ro").value = x;
</script>
<body>
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names-->
<!--Names-->
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<!--Input-->
<!--Input-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<form><input id="string1" type="number" value="0"></form>
</td>
</tr>
</table>
<table id="values">
<!--Values-->
<!--Values-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
thank you very much, that was a stupid mistake but can u explain me what u mean with the <id> part, i think it doesn't matter what u choose as id or does it?
– Jurijcorn
Mar 23 at 15:45
1
yes does not a matter.You could set anything as a id.But its not good practise.In future more no of coding and variable.its will be more confusing and complex.Use some related name of the activity element,eg:input get username set id="username"
. variable and name defining is one of the biggest task in coding
– prasanth
Mar 23 at 15:54
1
okay i see, better implement the good habits before getting used to bad ones. Thank you prasanth :)
– Jurijcorn
Mar 23 at 15:57
1
@Jurijcorn you are always welcome.Happy coding....
– prasanth
Mar 23 at 15:58
add a comment |
You're reading the value of form
, which has no value. You probably mean to read the value from the input
element.
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<input id="1" type="number" value="0">
</td>
</tr>
</table>
<table id="values">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
add a comment |
Your second table should be corrected in the following way. The id value "1" was referring the form element and not the input element.
<table id="input">
<!--Input--><!--Input-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><form><input type="number" value="0" id="1"></form></td></tr>
</table>
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315401%2fthe-specified-value-undefined-is-not-a-valid-number%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Mistake
- First thing
id
is not only numeric. so you must mix with some string - And
document.getElementById("string1")
is placed withform
not a input.so add id to input instead ofform
<script>
function test()
var x = document.getElementById("string1").value;
document.getElementById("ro").value = x;
</script>
<body>
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names-->
<!--Names-->
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<!--Input-->
<!--Input-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<form><input id="string1" type="number" value="0"></form>
</td>
</tr>
</table>
<table id="values">
<!--Values-->
<!--Values-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
thank you very much, that was a stupid mistake but can u explain me what u mean with the <id> part, i think it doesn't matter what u choose as id or does it?
– Jurijcorn
Mar 23 at 15:45
1
yes does not a matter.You could set anything as a id.But its not good practise.In future more no of coding and variable.its will be more confusing and complex.Use some related name of the activity element,eg:input get username set id="username"
. variable and name defining is one of the biggest task in coding
– prasanth
Mar 23 at 15:54
1
okay i see, better implement the good habits before getting used to bad ones. Thank you prasanth :)
– Jurijcorn
Mar 23 at 15:57
1
@Jurijcorn you are always welcome.Happy coding....
– prasanth
Mar 23 at 15:58
add a comment |
Mistake
- First thing
id
is not only numeric. so you must mix with some string - And
document.getElementById("string1")
is placed withform
not a input.so add id to input instead ofform
<script>
function test()
var x = document.getElementById("string1").value;
document.getElementById("ro").value = x;
</script>
<body>
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names-->
<!--Names-->
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<!--Input-->
<!--Input-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<form><input id="string1" type="number" value="0"></form>
</td>
</tr>
</table>
<table id="values">
<!--Values-->
<!--Values-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
thank you very much, that was a stupid mistake but can u explain me what u mean with the <id> part, i think it doesn't matter what u choose as id or does it?
– Jurijcorn
Mar 23 at 15:45
1
yes does not a matter.You could set anything as a id.But its not good practise.In future more no of coding and variable.its will be more confusing and complex.Use some related name of the activity element,eg:input get username set id="username"
. variable and name defining is one of the biggest task in coding
– prasanth
Mar 23 at 15:54
1
okay i see, better implement the good habits before getting used to bad ones. Thank you prasanth :)
– Jurijcorn
Mar 23 at 15:57
1
@Jurijcorn you are always welcome.Happy coding....
– prasanth
Mar 23 at 15:58
add a comment |
Mistake
- First thing
id
is not only numeric. so you must mix with some string - And
document.getElementById("string1")
is placed withform
not a input.so add id to input instead ofform
<script>
function test()
var x = document.getElementById("string1").value;
document.getElementById("ro").value = x;
</script>
<body>
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names-->
<!--Names-->
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<!--Input-->
<!--Input-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<form><input id="string1" type="number" value="0"></form>
</td>
</tr>
</table>
<table id="values">
<!--Values-->
<!--Values-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
Mistake
- First thing
id
is not only numeric. so you must mix with some string - And
document.getElementById("string1")
is placed withform
not a input.so add id to input instead ofform
<script>
function test()
var x = document.getElementById("string1").value;
document.getElementById("ro").value = x;
</script>
<body>
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names-->
<!--Names-->
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<!--Input-->
<!--Input-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<form><input id="string1" type="number" value="0"></form>
</td>
</tr>
</table>
<table id="values">
<!--Values-->
<!--Values-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<script>
function test()
var x = document.getElementById("string1").value;
document.getElementById("ro").value = x;
</script>
<body>
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names-->
<!--Names-->
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<!--Input-->
<!--Input-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<form><input id="string1" type="number" value="0"></form>
</td>
</tr>
</table>
<table id="values">
<!--Values-->
<!--Values-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<script>
function test()
var x = document.getElementById("string1").value;
document.getElementById("ro").value = x;
</script>
<body>
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<!--Names-->
<!--Names-->
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<!--Input-->
<!--Input-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<form><input id="string1" type="number" value="0"></form>
</td>
</tr>
</table>
<table id="values">
<!--Values-->
<!--Values-->
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
answered Mar 23 at 15:40
prasanthprasanth
15k21538
15k21538
thank you very much, that was a stupid mistake but can u explain me what u mean with the <id> part, i think it doesn't matter what u choose as id or does it?
– Jurijcorn
Mar 23 at 15:45
1
yes does not a matter.You could set anything as a id.But its not good practise.In future more no of coding and variable.its will be more confusing and complex.Use some related name of the activity element,eg:input get username set id="username"
. variable and name defining is one of the biggest task in coding
– prasanth
Mar 23 at 15:54
1
okay i see, better implement the good habits before getting used to bad ones. Thank you prasanth :)
– Jurijcorn
Mar 23 at 15:57
1
@Jurijcorn you are always welcome.Happy coding....
– prasanth
Mar 23 at 15:58
add a comment |
thank you very much, that was a stupid mistake but can u explain me what u mean with the <id> part, i think it doesn't matter what u choose as id or does it?
– Jurijcorn
Mar 23 at 15:45
1
yes does not a matter.You could set anything as a id.But its not good practise.In future more no of coding and variable.its will be more confusing and complex.Use some related name of the activity element,eg:input get username set id="username"
. variable and name defining is one of the biggest task in coding
– prasanth
Mar 23 at 15:54
1
okay i see, better implement the good habits before getting used to bad ones. Thank you prasanth :)
– Jurijcorn
Mar 23 at 15:57
1
@Jurijcorn you are always welcome.Happy coding....
– prasanth
Mar 23 at 15:58
thank you very much, that was a stupid mistake but can u explain me what u mean with the <id> part, i think it doesn't matter what u choose as id or does it?
– Jurijcorn
Mar 23 at 15:45
thank you very much, that was a stupid mistake but can u explain me what u mean with the <id> part, i think it doesn't matter what u choose as id or does it?
– Jurijcorn
Mar 23 at 15:45
1
1
yes does not a matter.You could set anything as a id.But its not good practise.In future more no of coding and variable.its will be more confusing and complex.Use some related name of the activity element,
eg:input get username set id="username"
. variable and name defining is one of the biggest task in coding– prasanth
Mar 23 at 15:54
yes does not a matter.You could set anything as a id.But its not good practise.In future more no of coding and variable.its will be more confusing and complex.Use some related name of the activity element,
eg:input get username set id="username"
. variable and name defining is one of the biggest task in coding– prasanth
Mar 23 at 15:54
1
1
okay i see, better implement the good habits before getting used to bad ones. Thank you prasanth :)
– Jurijcorn
Mar 23 at 15:57
okay i see, better implement the good habits before getting used to bad ones. Thank you prasanth :)
– Jurijcorn
Mar 23 at 15:57
1
1
@Jurijcorn you are always welcome.Happy coding....
– prasanth
Mar 23 at 15:58
@Jurijcorn you are always welcome.Happy coding....
– prasanth
Mar 23 at 15:58
add a comment |
You're reading the value of form
, which has no value. You probably mean to read the value from the input
element.
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<input id="1" type="number" value="0">
</td>
</tr>
</table>
<table id="values">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
add a comment |
You're reading the value of form
, which has no value. You probably mean to read the value from the input
element.
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<input id="1" type="number" value="0">
</td>
</tr>
</table>
<table id="values">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
add a comment |
You're reading the value of form
, which has no value. You probably mean to read the value from the input
element.
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<input id="1" type="number" value="0">
</td>
</tr>
</table>
<table id="values">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
You're reading the value of form
, which has no value. You probably mean to read the value from the input
element.
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<input id="1" type="number" value="0">
</td>
</tr>
</table>
<table id="values">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<input id="1" type="number" value="0">
</td>
</tr>
</table>
<table id="values">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
function test()
var x = document.getElementById("1").value;
document.getElementById("ro").value = x;
<table>
<tr>
<td><b><button onclick="test()">test</button></b></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<div id="flex-table">
<table id="names">
<caption>A: Vermögen</caption>
<tr>
<th>I. Anlagevermögen</th>
</tr>
<tr>
<td class="first">Grundstücke</td>
</tr>
<tr>
<td class="second">Gernotstraße</td>
</tr>
</table>
<table id="input">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<input id="1" type="number" value="0">
</td>
</tr>
</table>
<table id="values">
<caption> </caption>
<tr>
<th>
<p>€</p>
</th>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><input id="ro" type="number" value="0" readonly></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
answered Mar 23 at 15:40
jlowgrenjlowgren
2,99232139
2,99232139
add a comment |
add a comment |
Your second table should be corrected in the following way. The id value "1" was referring the form element and not the input element.
<table id="input">
<!--Input--><!--Input-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><form><input type="number" value="0" id="1"></form></td></tr>
</table>
add a comment |
Your second table should be corrected in the following way. The id value "1" was referring the form element and not the input element.
<table id="input">
<!--Input--><!--Input-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><form><input type="number" value="0" id="1"></form></td></tr>
</table>
add a comment |
Your second table should be corrected in the following way. The id value "1" was referring the form element and not the input element.
<table id="input">
<!--Input--><!--Input-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><form><input type="number" value="0" id="1"></form></td></tr>
</table>
Your second table should be corrected in the following way. The id value "1" was referring the form element and not the input element.
<table id="input">
<!--Input--><!--Input-->
<caption> </caption>
<tr><th><p>€</p></th></tr>
<tr><td> </td></tr>
<tr><td><form><input type="number" value="0" id="1"></form></td></tr>
</table>
answered Mar 23 at 15:42
HarshanaHarshana
357212
357212
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315401%2fthe-specified-value-undefined-is-not-a-valid-number%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Your id must be assigned to a input element, not the form itself.
– Marc
Mar 23 at 15:38
oh i see that was stupid, it works now. Thank you very much!
– Jurijcorn
Mar 23 at 15:44