Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
65
rated 0 times [  71] [ 6]  / answers: 1 / hits: 14585  / 9 Years ago, wed, february 25, 2015, 12:00:00

I have a input text field. I need to pass the values entered inside the element through onClick of javascript.



<form>
<fieldset>
<label>Common Site ID: </label><span><?php echo $commonsiteid ?></span><br>
<label>Acres: </label><input id=acre_value name=acre_value type=text value=<?php echo $acre; ?>>
</fieldset>
</form>
<input type=submit value=submit onclick=saveValue('<?php echo $_REQUEST['acre_value'] ?>')>


I am passing the value through submit onClick, Which is going empty. How do i pass value in this onclick function.


More From » php

 Answers
2

Have you tried writing something like following.



<input type=submit value=submit onclick=saveValue(document.getElementById('acre_value').value)>

[#39001] Tuesday, February 24, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
freddiem

Total Points: 456
Total Questions: 116
Total Answers: 101

Location: Dominica
Member since Mon, Jan 4, 2021
3 Years ago
;