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 6912795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:08:11+00:00 2026-05-27T09:08:11+00:00

<button type="submit" id="start-break" name="start" type="button" class="actv-btn-dft1 blbg" onClick="showhide(‘start-break’, ‘stop-break’);return false;" title="Start Break">Start Break</button> <button

  • 0
<button type="submit" id="start-break" name="start" type="button" class="actv-btn-dft1 blbg" onClick="showhide('start-break', 'stop-break');return false;"  title="Start Break">Start Break</button> 
<button type="submit" id="stop-break" type="button" class="actv-btn-dft1 orbg" onClick="showhide('stop-break', 'start-break');return false;"  style="display:none"  title="Stop Break">Stop Break</button>

I am using something like a toggle button where click of start makes visible stop then on click of stop start button is visible.

I am using showhide('start-break', 'stop-break') JavaScript function as described below:

function showhide(hideid,showid)
{
 document.getElementById(showid).style.display='block';
 document.getElementById(hideid).style.display='none';
}

I want to know why I am not able to get the value of the start or stop in the controller.

-> If I remove that return false in the onclick I get it submitted but the UI gets disturbed (the button does not remain in the stop position when start is clicked).

  • 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-27T09:08:12+00:00Added an answer on May 27, 2026 at 9:08 am

    The return false; is blocking the submit. When the form is submitted, the page will of course be refreshed with the response of the form submit request.

    Just don’t use JS to show/hide the buttons. Use the server side language for this (based on your profile and the edit history you’re using “J2EE” and thus you’re familiar with JSP):

    <c:if test="${empty param.start}">
       <button type="submit" name="start">Start</button>
    </c:if>
    <c:if test="${not empty param.start}">
       <button type="submit" name="stop">Stop</button>
    </c:if>
    

    An alternative is to use Ajax to submit the form. But that’s a completely different story.

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

Sidebar

Related Questions

HTML has an input button type to reset all fields in a form to
I'm using a form containing a button type shown below: <form method=post action=> <button
I have a Button Style: <Style x:Key=ButtonStyle1 TargetType={x:Type Button}> <Setter Property=Template> <Setter.Value> <ControlTemplate TargetType={x:Type
Button class: class SubmitButton extends JButton implements ActionListener { public SubmitButton(String title){ super(title); ....
I am using jQuery to swap out the image here after the submit button
I have the following form as part of a registration process: <form class="form1" id="register_form1"
this is probably really simple for a jQuery expert. I have <div id="form23"><form><textarea>blahblah</textarea><input type="button"
$(document).ready(function() { $(".addtophundredwatchlist").click(function() { $.ajax({ type : "GET", url : "/watchlisttophundred/", success : function(data){
I keep wondering why did facebook use like submit from button and not just
How do I get this javascript to run every second? source code: <script type="text/javascript">

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.