Jquery : Display form data on the same webpage page

Discussion in 'JavaScript' started by anoopcr, Nov 19, 2012.

  1. #1
    I have created a form and I would like to display the for data on the same page below current datas.Below is my script








    <html>
    <body>
    <head>
    Sym CLI script generator
    </head>
    <br>
    </br>


    <form>
    SID of Array: <input type="text" name="sid">
    Device: <input type="text" name="device"></br>
    <br>
    </br>
    <INPUT TYPE="button" NAME="button" Value="generate" onClick="testResults(this.form)">
    </form>
    <script LANGUAGE="JavaScript">
    function testResults (form) {
    var value1 =form.sid.value;
    var value2 =form.device.value;
    document.write('symmetrix id is' + value1 + 'and device is ' + value2);
    }
    </script>


    </body>
    </html>








    When I am clicking generate button it going to a different page or I am not able to see the form.I would like to display the out below the form.need your help to resolve this
     
    anoopcr, Nov 19, 2012 IP