![]() |
How to get array value in input box
Code:
<%-- |
You cannot return values from inside a loop. Ok, you can, but it will stop the loop and return only the first value b[0] of the array.
What EXACTLY do you want to achieve? |
Quote:
|
This is not EXACTLY what you want, is it?
Code:
var b=[]; |
Quote:
{ var a=new Array; a[0]="sector1"; a[1]="sector2"; a[2]="sector3"; var i; for(i=0;i<=((a.length)-1);i++){ document.getElementById("demo").innerHTML=a[i]; //document.write(a[i]); } } I want to print all the array value in the "same" document in <p id="demo"></p> |
Quote:
I figured you'd want some spaces between your concatenations. Obviously you can just take out the space if you don't want/need it. EDIT: I just realized. devnull's and my posts do pretty much the exact same thing. Probably the reason it's not working (if that's the entirety of your HTML up there) is because you don't have a "<p id="demo"></p>" in the first place. Code:
function Noida() |
there is a text box with the id demo. if you want the results to end up there you need to change that line to:
Code:
document.getElementById("demo").value=result;Code:
<select name="drop" size="1" onchange="Gurgaon()"> |
| All times are GMT +1. The time now is 09:29 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.