Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7925833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:28:29+00:00 2026-06-03T18:28:29+00:00

print <Font face=\calibri, Arial\><table id=\rnatable\ border=2px width=100%>; print <th></th>; print <th>a</th>; print <th>b</th>; print

  • 0
print "<Font face=\"calibri, Arial\"><table id=\"rnatable\" border=2px width=100%>";
print "<th></th>";
print "<th>a</th>";
print "<th>b</th>";
print "<th>c</th>";
print "<th>d</th>";
print "<th>e</th>";
print "<th>f</th>";
print "<th>g</th>";



while($array = mysql_fetch_array($sql_query))
{
$id=$array['a'];
print "<tr id=\"newtr\">";
print "<td><input id=\"check\" type=\"checkbox\" name=\"keyword[]\" value=\"$id\" ></td>";
print "<td>".$array['a']."</td>";
print "<td>".$array['b']."</td>";
print "<td>".$array['c']."</td>";
print "<td>".$array['d']."</td>";
print "<td>".$array['e']."</td>";
print "<td>".$array['f']."</td>";

print "<td>
<a href=\"http://localhost/rnasearch/retrieve.php?a=$id\">bla</a>
</td></tr></font>";

}

print "</table>";
}

this is part of a php searchengine script that i wrote to retrieve data from a database and as you can see the last column that is g contains a link which when clicked takes the user to the second php script which retrieves additional information of that entry, but this is done for only single entries so as you can see i introduced checkboxes so that the user can check any number of checkboxes and retrieve information as per their wish

now to do this i created a

    <div id="floatMenu"> 
<ul class="menu1"> 
<center><li><form name="senddata" method="POST" action="http://localhost/retrieve.php" style="display:inline;"><input id="fasta" type="text" class="multitext"><input name="Fasta" type="Submit" value="Retrieve Fasta"></form>

this is a css floating menu….so far so good….everything went fine….
after this i had to write a javascript to do this and i’ve been stuck there searching forums for the last 4 days!

this is the javascript i found from somewhere which came close to doing wht i wanted it to do

    window.onload = function () { 
var cb = document.getElementById('check');
var fasta = document.getElementById('fasta');
cb.onclick = function () {fasta.value = cb.value + ","; 
};};

this script only sends the value of the first checkbox in the table, the others are not found by it, mind you its not the first checkbox selected its the first checkbox that is present in the table

how can i resolve this problem so that even if i have n number of checkboxes in my table, if the user chooses to do so they can retrieve n number of information….please help i’ve almost lost hope in this!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T18:28:32+00:00Added an answer on June 3, 2026 at 6:28 pm

    IDs are meant to be unique in one HTML Document. So you can’t use them to retrieve many of them with the same Id. You may have to modify your PHP and JS like this:

    $i=0;
    while($array = mysql_fetch_array($sql_query))
    
    {
    $id=$array['a'];
    print "<tr id=\"newtr\">";
    print "<td><input id=\"check_$i\" type=\"checkbox\" name=\"keyword[]\" value=\"$id\" ></td>";
    print "<td>".$array['a']."</td>";
    print "<td>".$array['b']."</td>";
    print "<td>".$array['c']."</td>";
    print "<td>".$array['d']."</td>";
    print "<td>".$array['e']."</td>";
    print "<td>".$array['f']."</td>";
    
    print "<td>
    <a href=\"http://localhost/rnasearch/retrieve.php?a=$id\">bla</a>
    </td></tr>";
    $i++;
    }
    
    print "</table>";
    }
    

    And

        window.onload = function () { 
        var cb = document.getElementsByTagName('input');
        var fasta = document.getElementById('fasta');
        for (i=0;i<cb.length;++i)
        {
          if ( cb[i].type === 'checkbox' && cb[i].name === 'keyword[]')
              cb[i].onclick = function (e) {
                var str = e.target.value + ","
                if(e.target.checked)
                    fasta.value += str;
                else
                {
                    var ind = fasta.value.indexOf(str);
                    fasta.value = fasta.value.substr(0, ind) + fasta.value.substr(ind+str.length,fasta.value.length);
                }
        }
    };};
    

    You can find a jsFiddle here: http://jsfiddle.net/ZfmNw/1/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HTML5-canvas and write text with context.fillText(...); using a @font-face-font. Displaying the
so what 'font-family' should I use in a print stylesheet?
I understand that css3.0 supports the Font-Face tag, correctly in the latest Opera, Safari,
I need to write some fixed-width font (i.e Courier New or Consolas) text to
I'm using a barcode font "Free 3 of 9 Extended Regular" and the print
I using below codes to print ABC in java: String NAME=ABC; int FONT_SIZE=100; BufferedImage
I'm using @font-face to display League Gothic on a website, but it's not showing
I have downloaded a font from the internet. Now I want to Print the
I am trying to print Arabic text in cell inside table (in pdf) using
I am supposed to print an array of invoices to our clients. There is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.