Click here to Skip to main content
15,885,278 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionHow do I get the value of a drop down list into a javascript based table? Pin
shabbarank511-Oct-11 0:46
shabbarank511-Oct-11 0:46 
AnswerRe: How do I get the value of a drop down list into a javascript based table? Pin
Dennis E White11-Oct-11 19:45
professionalDennis E White11-Oct-11 19:45 
GeneralRe: How do I get the value of a drop down list into a javascript based table? Pin
shabbarank511-Oct-11 22:16
shabbarank511-Oct-11 22:16 
QuestionCreating a Javascript table and populating from php/mysql list Pin
shabbarank57-Oct-11 1:17
shabbarank57-Oct-11 1:17 
AnswerRe: Creating a Javascript table and populating from php/mysql list Pin
Manfred Rudolf Bihy7-Oct-11 2:31
professionalManfred Rudolf Bihy7-Oct-11 2:31 
GeneralRe: Creating a Javascript table and populating from php/mysql list Pin
shabbarank57-Oct-11 2:34
shabbarank57-Oct-11 2:34 
GeneralRe: Creating a Javascript table and populating from php/mysql list Pin
Manfred Rudolf Bihy7-Oct-11 3:06
professionalManfred Rudolf Bihy7-Oct-11 3:06 
AnswerRe: Creating a Javascript table and populating from php/mysql list Pin
Manfred Rudolf Bihy7-Oct-11 3:52
professionalManfred Rudolf Bihy7-Oct-11 3:52 
I've composed this small example utilizing jQuery. I've spared my self the trouble of adding the part where the user can select entries from a drop down list as this does not seem to be your problem. This solution only concentrates on how elements can be added dynamically by using jQuery. Enjoy!

JavaScript
<html>
    <title>Add row to a table</title>
    <head>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
        <script type="text/javascript">
            function addRow(column1, column2, column3, column4)
            {
                $('#theTable > tbody:last').append('<tr><td>' + column1 + '</td><td>' + column2 + '</td><td>' + column3 + '</td><td>' + column4 + '</td></tr>'); 
            }
        </script>
    </head>
    <body>
        <h3>Add row to a table</h3>
        <input type="button" value="Add a row!" onclick="addRow('This', 'is', 'a', 'test');"></br>
        <table id="theTable" border="yes">
            <tbody>
            </tbody>
        </table>
    </body>
</html>


Regards,

—MRB

"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925

QuestionTrivial Pursuit Pin
goodideadave3-Oct-11 8:43
goodideadave3-Oct-11 8:43 
AnswerRe: Trivial Pursuit Pin
AspDotNetDev3-Oct-11 9:29
protectorAspDotNetDev3-Oct-11 9:29 
AnswerRe: Trivial Pursuit Pin
TheGreatAndPowerfulOz3-Oct-11 9:59
TheGreatAndPowerfulOz3-Oct-11 9:59 
GeneralRe: Trivial Pursuit Pin
goodideadave3-Oct-11 10:23
goodideadave3-Oct-11 10:23 
GeneralRe: Trivial Pursuit Pin
TheGreatAndPowerfulOz3-Oct-11 10:57
TheGreatAndPowerfulOz3-Oct-11 10:57 
GeneralRe: Trivial Pursuit Pin
goodideadave3-Oct-11 11:37
goodideadave3-Oct-11 11:37 
QuestionJavascript validation Pin
vanikanc29-Sep-11 10:19
vanikanc29-Sep-11 10:19 
GeneralRe: Javascript validation Pin
Shahriar Iqbal Chowdhury/Galib29-Sep-11 11:24
professionalShahriar Iqbal Chowdhury/Galib29-Sep-11 11:24 
AnswerRe: Javascript validation Pin
Graham Breach29-Sep-11 21:20
Graham Breach29-Sep-11 21:20 
GeneralRe: Javascript validation Pin
Manfred Rudolf Bihy29-Sep-11 22:31
professionalManfred Rudolf Bihy29-Sep-11 22:31 
GeneralRe: Javascript validation Pin
vanikanc30-Sep-11 3:48
vanikanc30-Sep-11 3:48 
AnswerRe: Javascript validation Pin
Luc Pattyn30-Sep-11 4:16
sitebuilderLuc Pattyn30-Sep-11 4:16 
GeneralRe: Javascript validation Pin
vanikanc30-Sep-11 5:37
vanikanc30-Sep-11 5:37 
GeneralRe: Javascript validation Pin
arya168514-Oct-11 7:33
arya168514-Oct-11 7:33 
AnswerRe: Javascript validation Pin
Mohibur Rashid2-Oct-11 19:11
professionalMohibur Rashid2-Oct-11 19:11 
QuestionRetry Cancel Pin
berba29-Sep-11 0:59
berba29-Sep-11 0:59 
AnswerRe: Retry Cancel Pin
twseitex29-Sep-11 9:15
twseitex29-Sep-11 9:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.