JavaScript and client side scripting.
Moderator: General Moderators
thatsme
Forum Commoner
Posts: 87 Joined: Sat Apr 07, 2007 2:18 am
Post
by thatsme » Tue Feb 12, 2008 7:21 am
Code: Select all
<input type='text' name='ans[]' id = 'ans' value=$ans[$i]>
How to send ans values to javascript function?
I tried,
Code: Select all
<input type='submit' name='submit' value='submit' onClick='SendValues(ans)'>, without any success.
Thanks
superdezign
DevNet Master
Posts: 4135 Joined: Sat Jan 20, 2007 11:06 pm
Post
by superdezign » Tue Feb 12, 2008 9:20 am
What does the function, "SendValues()," do?
thatsme
Forum Commoner
Posts: 87 Joined: Sat Apr 07, 2007 2:18 am
Post
by thatsme » Tue Feb 12, 2008 1:19 pm
it is an ajax function which will send those values to ajax.php for insert/updated those values. I also tried document.getElementById. Another thing i would like to know, if i use get method in ajax, can i send more values like descriptions etc?
JellyFish
DevNet Resident
Posts: 1361 Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA
Post
by JellyFish » Tue Feb 12, 2008 4:36 pm
So long as ans is defined in javascript you should be able to pass it to SendValues(). Where are you defining ans as an array?