October 24th, 2012, 06:17 AM
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.
October 24th, 2012, 08:34 PM
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.
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.