Insert javascript variable value in body of HTML page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gpo
    New Member
    • Nov 2006
    • 6

    Insert javascript variable value in body of HTML page

    I've done a form validation and I want to submit the form details output into the HTML page,so that I can view the details. How can you doing it using innerHTML
    here's the form code.

    [HTML]<form name="testform" action="exercis e.html"
    onSubmit="retur n checkrequired(t his)">
    <pre>
    Company: <input type="text" name="requiredC ompany">

    Position: <input type="text" name="requiredP osition">

    From date <input type=text name=from onBlur="checkda te(this)" size=11 maxlength=11>

    To date <input type=text name=to onBlur="checkda te(this)" size=11 maxlength=11>

    Description: <textarea name="requiredD escription"></textarea>


    <input type='button' value="Submit">
    </pre>
    </form>[/HTML]
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Put a div on the page, e.g.
    [html]<div id="output"></div>[/html]then set its innerHTML:
    [code=javascript]document.getEle mentById("outpu t").innerHTM L = jsVar;[/code]

    Comment

    Working...