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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:43:41+00:00 2026-05-11T06:43:41+00:00

So I found this recommendation, but I can’t quite seem to figure out how.

  • 0

So I found this recommendation, but I can’t quite seem to figure out how.

This is the code I originally started with:

   function greySubmits(e) {       var value = e.srcElement.defaultValue;       // This doesn't work, but it needs to       $(e).insert('<input type='hidden' name='commit' value='' + value + '' />');        // This causes IE to not submit at all       $$('input[type='submit']').each(function(v) {v.disabled = true;})    }     // This works fine    Event.observe(window, 'load', function() {      $$('input[type='submit']').each(function(e) {         Event.observe(e, 'click', greySubmits);      });   }); 

Anyway, I am pretty close, but I can’t seem to get any further.

Thanks for any help at all!

Update: Sorry, I guess I wasn’t entirely clear. I’d like to disable all of the submit buttons when someone clicks a submit button. But I do need to send along the value of the submit button so the server knows which button I clicked, hence the insert call. (Note: insert does not create a child of the element you call it on.) And then after disabling the submit buttons I need to call the containing form of the submit buttons submit call, as IE will not submit after you disable the button. Does that make sense?

  • 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. 2026-05-11T06:43:42+00:00Added an answer on May 11, 2026 at 6:43 am

    I finally got it to work. Ryan helped so I’ll upvote him 🙂 Here’s the code:

      function replaceSubmit(e) {     var el = e.element();     Element.insert(el, { 'before': '<input type='hidden' name='' + el.name + '' value='' + el.value +'' />'});   }    function greySubmits(e) {     // Don't disable the submit if the submit was stopped with a return(false)     if (e.returnValue) {       $$('input[type='submit']').each(function(v) {v.disabled = true;})     }   }    function fixButtons() {     $$('input[type='submit']').each(function(v) {         if (Element.hasClassName(v, 'disabled')) {           v.disabled = true;         } else {           v.disabled = false;         }       });   }    Event.observe(window, 'load', function() {       fixButtons();       $$('input[type='submit']').each(function(e) {           Event.observe(e, 'click', replaceSubmit);         });       $$('form').each(function(e) {           Event.observe(e, 'submit', greySubmits);         });     }); 

    The fixButtons is so that when people click the back button the page will fix all the buttons. And if you want to disable a button and have it not re-enable on a back you just give it a class of disabled.

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

Sidebar

Ask A Question

Stats

  • Questions 74k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Something like this (I have re-constructing your code, as it… May 11, 2026 at 2:19 pm
  • added an answer Could you just start the updater using Process.Start and have… May 11, 2026 at 2:19 pm
  • added an answer LINQ to XML is indeed the way here: // Note:… May 11, 2026 at 2:19 pm

Related Questions

So I found this recommendation, but I can't quite seem to figure out how.
Recently I asked a question about how to clean up what I considered ugly
I'm attempting to help our network engineers troubleshoot a situation for one of our
I know it's simple to implement, but I want to reuse something that already
I have a development vm which is running sql server as well as some

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.