Click here to Skip to main content
16,018,534 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<!doctype html>
trying to add unorder list users through form input using javascript

please advise

<form>
User Name:<input type="text" name="username" placeholder="name">
Email :<input type="email" name="email" placeholder="me@example.com">
<button>adduser</button>
</form>

USERS:



    <html>
    -would like to add uer list using submit using javascript
    Posted
    Comments
    Rana Zarour 26-Feb-14 14:10pm    
    you can add new input using javascript then you can save your form to do that you have to give input the same name and when you post your form read your value as array
    oknaru 27-Feb-14 14:05pm    
    Thanks Rana, but i am a beginner still improving

    1 solution

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
    <script type="text/javascript">

    var element = null;
    var container = null;

    function Populateusers()
    {
    $("#UsersList").append('' + $('#name').val() + ' ' + $('#email').val() + '');
    }

    </script>
    </head>
    <body>

    User Name:<input id="name" type="text" name="username" placeholder="name">
    Email :<input id="email" type="email" name="email" placeholder="me@example.com">
    <button id="uxButtonAddUser" önclick="Populateusers(); return false;">adduser</button>

    </body>
    </html>

    Hope This Will help you.
     
    Share this answer
     
    v2

    This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



    CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900