How can I write document.write() functions inside a struts form. Although I give the id of each element in a javascript file, above js functions always write outside of the form. I need to add a line above of the s:textarea which is come from the javascript. How can I fix it?

Divsok,

document.write() functions inside a struts form

I'm struggling to understand what you might be attempting here. document.write() isn't the sort of statement I would normally associate with Struts.

Can you provide some code please.

<s:form action="">
    //insert javascript code here <script>function()</script>
    <s:textarea name="post" rows="10" cols="50" label="Your Post" labelposition="top" cssClass="post_area"/>
    <img id="loadingImage" src="images/loadingAnimation.gif" style="display:none"/>
    <sx:submit value="submit" targets="form" showLoadingText="false" indicator="loadingImage" cssClass="submit_button" />
</s:form>

how can i do this?because i need to print some images by js.the img tag also outside of the form

I'm struggling to understand what you might be attempting here. document.write() isn't the sort of statement I would normally associate with Struts.

Can you provide some code please.

How and when does javascript acquire the data that tells it what HTML to write?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.