JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2012, 06:17 AM
satyamisno1 satyamisno1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 1 satyamisno1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 54 sec
Reputation Power: 0
Post Homework - How to pass an array of elements to a function in java script??

How to pass an array of elements to a function in java script from php code of same code file, on button click event.

Detail Description of Problem:

1) we will check/uncheck some checkboxes
2) those checkboxs names which are checked should be stored in an array.
3) on click of a button, those array values will be sent to a database query, which will return the table details of those names in database.
4) those returned values should be desplaied in atable formate in browser.


now problem is i'm not getting how to write code for this.

ple help me out with a simple solution/code.

Reply With Quote
  #2  
Old October 24th, 2012, 08:34 PM
web_loone08's Avatar
web_loone08 web_loone08 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 599 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 40 m
Reputation Power: 69
Not going to write the code for you, because then what would be the purpose of me doing YOUR homework; you wouldn't learn anything like that. Although... I will tell you how to begin.

1.) Get the value(s) from your checkbox(s) and validate, as needed.
2.) Then take the checkbox values and use a JavaScript push() prototype; to add the values into the array. You can do it without the prototype; but this would be the easiest way.
3.) Insert the array key(s) into an AJAX query; to preform a database query (from your server side page).
4.) Use AJAX to retrieve the responseText (from your server side page) and then... use that responseText to display the data, in your table.

And then... your done; good luck.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Homework - How to pass an array of elements to a function in java script??

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap