/    Sign up×
Community /Pin to ProfileBookmark

report generator

hello to everybody!i’m new webdeveloper beginner!ι’ll try to learn php,mysql,javascript and i think the best way to learn is to create something.ι decided to create a report generator tool for a web page.i have one table with 3 columns ans 3 rows.in this query i take all tables from a database and show it in the first column->>
<?

$tables =”SHOW TABLES FROM database_name like ‘jos_vm%'”;
$table_query=mysql_query($tables);
while($showtablerow=mysql_fetch_array($table_query))
{
?>
<input name=”table_check_box” type=”checkbox” value=<? echo “<br/>”.$showtablerow[0].”<br/>”; ?></br>
<?
}
?>
every table has a checkbox and number of tables are 50!so let’s go to my problem….i have a button and i want this button to check which checkboxes are checked and print it in the second column and after this step with sql query i’ll take the fields from every table!so i write a javascript code but is wrong

<script>
function step1(chk1){
var total=””;
for(var i=0; i < document.form1.table_check_box.length; i++){
if(document.form1.table_check_box[i].checked)
total +=document.form1.table_check_box[i].value + “n”
}
if(total==””)
alert(“select scripts”) else
alert (total)

return false;
}
</script>

i hope to understand what i want to do!!

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @tasox spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...