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

  • SEARCH
  • Home
  • 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 8829953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:57:17+00:00 2026-06-14T07:57:17+00:00

I have a layout.jsp that I am using to build a page using multiple

  • 0

I have a layout.jsp that I am using to build a page using multiple other jsp’s.

In my main content jsp pages I have a button or two. In the current version I am positioning the div with the buttons relatively.

I am switching the way the page is designed. I created a div in my layout page to place the buttons into. I gave it an appButtonDiv class.

The issue I am running into is I do not know how to create a button insert it into the div. I would like to do this on document ready.

Here is the div I want to put the button(s) into.

    <div class="row-fluid verticalmenubottom">
        <div class="span12 verticalMenuCell appButtonDiv"></div>
    </div>

Below is a example button.

 <button type="submit" id="searchButton" name="searchButton"
                                value='<spring:message code="Generic.Search"/>'/>
                        Search</button>

There are some cases where I will have multiple buttons.

  • 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-06-14T07:57:18+00:00Added an answer on June 14, 2026 at 7:57 am

    I haven’t JSP competence, however you are asking how to add content to an element on document ready.

    Using JQuery, you can do this:

    $(document).ready(init);
    

    else without JQuery, you might use the onload event of your body element:

    <body onload="init()">...</body>
    

    Then declare this function in your script tag:

    function init() {
    //this executes on document ready
    
    //create your elements
        var externDiv = document.createElement('div');
        var internDiv = document.createElement('div');
        externDiv.className = 'row-fluid verticalmenubottom';
        internDiv .className = 'span12 verticalMenuCell appButtonDiv';
        externDiv.appendChild(internDiv);
    
    //find your button and put the new elements in it (check that your jsp don't change the id client-side)
        var btn = document.getElementById('searchButton');
        btn.appendChild(externDiv);
    }
    

    That’s it!

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

Sidebar

Related Questions

I am using Tiles within my web-application. I have a standard-layout (standard.jsp) within the
I have written two JSP pages: outerPage.jsp and innerPage.jsp . The outerPage.jsp includes innerPage.jsp
I have a complex layout situation in which an horizontal LinearLayout holds two other
Initially I have this layout: <ul id=state_${abbr}></ul> on the jsp page and I need
Problem: I have two identical pages home.jsp and contact.jsp with same structure. They differs
I have a page that shares the same footer / header layout and design.
I have a layout with two children one after another, like this: |<view1><text1> |
I have a panel in my Page1.jsp: <webuijsf:panelLayout binding=#{Page1.dynamicFieldsPanel} id=dynamicFieldsPanel -rave-layout: grid/> Then I
In a tomcat JSP application I have this directory layout: webapps/ myProjectName/ index.jsp WEB-INF/
I'm looking at this java web application that is using hibernate, jsp's, and spring

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.