Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5972775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:42:21+00:00 2026-05-22T20:42:21+00:00

In Jsp while i press submit button instead of passing values to action. I

  • 0

In Jsp while i press submit button instead of passing values to action.
I want the HTML content of that form with all values it is possible??

If possible give an example. Let me know if any clarification is needed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:42:22+00:00Added an answer on May 22, 2026 at 8:42 pm

    It isnt clear where do you need this html content?

    If on browser, use an alert in an onSubmit event –

    alert(document.myForm.innerHTML);
    

    To get this on to server side, you will need to pass this content as part of form submission, maybe in a hidden field.

    in onSubmit() event:
    myForm.myHiddenHtmlContent = myForm.innerHTML;
    

    For InnerHTML with current form values:
    Its not plain easy, check out the following link –
    innerHTML with current form values
    This uses jquery, but you can also write your own without it as well.

    Including an example –
    Ok, it looks like it works in IE but not in FireFox. Basically you need to setAttribute('value') for each form element to make it work.

    Use following –

    var formElements = document.getElementById("myFormId").elements;
    for (var x = 0; x <= formElements.length - 1; x++)
    {
        if (formElements[x].value) {
            formElements[x].setAttribute("value", formElements[x].value);
        }
    }
    
    //Now you are ready to call innerHTML
    myForm.myHiddenHtmlContent = myForm.innerHTML;
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a JSP file I'm getting a: Type expected (found 'try' instead) Error while
The jsp page named uploadTextContent.jsp contains the following code, <html:cancel value=Close accesskey=c styleClass=Button onclick=JavaScript:closeWellFormatContent('<%=request.getAttribute(message)%>')
I have the following JSP File and Servlet file <html> <head> <meta http-equiv=Content-Type content=text/html;
I have a HTML text area in a JSP page. When I continuously press
Its been a while since I had to do some Java/JSP... I have a
In a JSP page, I created a <h:form enctype=multipart/form-data> with some elements: <t:inputText> ,
Writing a JSP page, what exactly does the <c:out> do? I've noticed that the
I am using Jetty web server, and while loading JSP page, its getting loaded
I'm using JSP & Struts2 for development. When I login, I call an action,
we have a classic JSP + Servlets application and would like to show Content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.