473,856 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Submit Form after disabling submit button

91 New Member
I created a submit form that calls a javascript:AjAX Command that will call the data and submit it without have the page refresh. This works perfect in Firefox however in IE and Opera when the submit button is pressed it just disables the button and does not submit the data. Any idea?

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="<?=$config->getKey('Site_URL')."js/AJAX.js"?>"></script>
  3. <form name="EditUser" method="post" accept="text/plain" action="javascript:SubmitEditForm('/admin/edituser/<?=$_REQUEST[2]?>/save');">
  4. <fieldset>
  5. <legend>User Details:</legend>
  6. <table class="EditForm">
  7. <tbody>
  8. <tr><td>Name:</td>
  9. <td><input type="text" name="name" maxlength="155" value="<?=$results['Full_Name']?>"></td></tr>
  10. <tr><td>Title:</td>
  11. <td><input type="text" name="title" maxlength="155" value="<?=$results['Title']?>"></td></tr>
  12. <tr><td>Email:</td>
  13. <td><input type="text" name="email" maxlength="155" value="<?=$results['Email'] ?>"></td></tr>
  14. <tr><td>AD Account:</td>
  15. <td><input type="text" maxlength="25" name="ad" value="<?=$results['AD'] ?>"></td></tr>
  16. <tr><td>Receive Alerts:</td>
  17. <td><input type="checkbox" name="alerts" value="1" <?=$func->iif($results['Send_Alerts'],"checked","") ?>></td>
  18. </tr>
  19. </tbody>
  20. </table></fieldset><br>
  21. <fieldset>
  22. <legend>Access Details:</legend>
  23. <table class="EditForm">
  25. <tbody>
  26. <tr>
  27. <td><input type="checkbox" name="access[]" value="1" <?=$func->iif($func->inAccess(AL_LOGIN,$results['Access']),"checked","") ?>>Login</td>
  28. <td><input type="checkbox" value="2" name="access[]" <?=$func->iif($func->inAccess(AL_GRAPHS,$results['Access']),"checked","") ?>>View Graphs</td>
  29. <td><input type="checkbox" value="4" name="access[]" <?=$func->iif($func->inAccess(AL_TSM_LIST,$results['Access']),"checked","") ?>>View Other TSMs<br>
  30.     </td></tr><tr><td><input type="checkbox" name="access[]" value="256" <?=$func->iif($func->inAccess(AL_ADD_USER,$results['Access']),"checked","") ?>>Add User<br>
  31.     </td><td><input type="checkbox" value="512" name="access[]" <?=$func->iif($func->inAccess(AL_EDIT_USER,$results['Access']),"checked","") ?>>Edit User<br>
  32.     </td><td><input type="checkbox" value="1024" name="access[]" <?=$func->iif($func->inAccess(AL_REMOVE_USER,$results['Access']),"checked","") ?>>Remove User<br>
  33.     </td></tr><tr><td><input type="checkbox" value="2048" name="access[]" <?=$func->iif($func->inAccess(AL_EDIT_CONFIG,$results['Access']),"checked","") ?>>Edit Config<br>
  34.     </td><td><input type="checkbox" name="access[]" value="4096" <?=$func->iif($func->inAccess(AL_CHANGE_TEMPLATE,$results['Access']),"checked","") ?>>Change Template<br>
  35.     </td><td>
  36.     </td></tr><tr><td colspan="3">Access Level (higher can edit lowers access)<br>
  37.     <input type="radio" class="a_level" name="a_level" value="0" <?=$func->iif($func->getAccessLevel($results['Access']) === 0,"checked","") ?> <?=$func->iif($func->getAccessLevel($_SESSION['Access']) <= $func->getAccessLevel($results['Access']) && $func->getAccessLevel($_SESSION['Access']) != 6,"disabled","") ?>>None 
  38.     <input type="radio" class="a_level" name="a_level" value="16384" <?=$func->iif($func->inAccess(AL_LEVEL_1,$results['Access']),"checked","") ?> <?=$func->iif($func->getAccessLevel($_SESSION['Access']) != 6 && $func->getAccessLevel($_SESSION['Access']) <= 1,"disabled","") ?>>1 
  39.     <input type="radio" class="a_level" name="a_level" value="32768" <?=$func->iif($func->inAccess(AL_LEVEL_2,$results['Access']),"checked","") ?> <?=$func->iif($func->getAccessLevel($_SESSION['Access']) != 6 && $func->getAccessLevel($_SESSION['Access']) <= 2,"disabled","") ?>>2 
  40.     <input type="radio" class="a_level" name="a_level" value="65536" <?=$func->iif($func->inAccess(AL_LEVEL_3,$results['Access']),"checked","") ?> <?=$func->iif($func->getAccessLevel($_SESSION['Access']) != 6 && $func->getAccessLevel($_SESSION['Access']) <= 3,"disabled","") ?>>3 
  41.     <input type="radio" class="a_level" name="a_level" value="131072" <?=$func->iif($func->inAccess(AL_LEVEL_4,$results['Access']),"checked","") ?> <?=$func->iif($func->getAccessLevel($_SESSION['Access']) != 6 && $func->getAccessLevel($_SESSION['Access']) <= 4,"disabled","") ?>>4 
  42.     <input type="radio" class="a_level" name="a_level" value="262144" <?=$func->iif($func->inAccess(AL_LEVEL_5,$results['Access']),"checked","") ?> <?=$func->iif($func->getAccessLevel($_SESSION['Access']) != 6 && $func->getAccessLevel($_SESSION['Access']) <= 5,"disabled","") ?>>5 
  43.     <input type="radio" class="a_level" name="a_level" value="524288" <?=$func->iif($func->inAccess(AL_SYSTEM_ADMIN,$results['Access']),"checked","") ?><?=$func->iif($func->getAccessLevel($_SESSION['Access']) != 6 && $func->getAccessLevel($_SESSION['Access']) <= 6,"disabled","") ?>>System Admin
  44.     </td></tr>
  45.     </tbody>
  46.     </table></fieldset>
  47. <br>
  48. <fieldset>
  49. <legend>TSM Report Properties (Information MUST be exactly the same as crystal displays):</legend>
  50. <table>
  52.     <tbody>
  53.         <tr>
  54.             <td>Name:</td>
  55.             <td><input type="text" name="tsm_name" value="<?=$results['Name'] ?>" <?=!$results['Include']?'disabled':''?>></td>
  56.         </tr>
  57.         <tr>
  58.             <td>Group:</td>
  59.             <td><select name="tsm_group" <?=!$results['Include']?'disabled':''?>>
  60.             <? foreach($enums as $key)
  61.                 {
  62.                     echo "<option ".$func->iif($key==$results['Group'],'selected','').">".$key."</option>";
  63.                 } ?>
  64.             </select></td>
  65.         </tr>
  66.         <tr>
  67.             <td>Include in reports:</td>
  68.             <td><input type="checkbox" name="tsm_include" value="1" onClick="tsm_name.disabled=this.checked?0:1;tsm_group.disabled=this.checked?0:1;" <?=$func->iif($results['Include'],"checked","") ?>></td>
  69.         </tr>
  70.     </tbody>
  71. </table></fieldset>
  72. <br>
  73. <table><tr><td><input type="submit" value="Save" name="UserEdit_Save" onClick="this.disabled=true;"></td><td><a
  74.     href="javascript:void(0);" onclick="javascript:LoadData('/admin/users');">Cancel</a></td></tr></table></form>
Mar 28 '08 #1
1 2256
91 New Member
Had to do this as with the button disabled it wont submit the form;

Expand|Select|Wrap|Line Numbers
  1. <input type="submit" value="Save" name="UserEdit_Save" onClick="this.value='Processing form';this.disabled=true;this.form.submit();">
Mar 28 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: David Bradbury | last post by:
Hi On my form, as soon as the user clicks my submit button a message pops up saying "Form processing" as the form submits. This is fine as long as the user only clicks the submit button once. However, if I try and stop the user submitting a second time (if they click the button for a second time despite the form processing message) by using a submission counter then my form just hangs forever with the "Form processing" message. Any...
by: JSjones | last post by:
Hi all, I'm new to these boards and my javascript experience is fairly limited and basic so please bear with me. Anyway, on to the question and some background. I'm developing using ColdFusion 4.5 and a good deal of the page processing depends on whether or not a control is defined. To prevent users from clicking on a submit button more than once or clicking on another submit button before the page has finished processing I have...
by: anonieko | last post by:
Scenario: You have a page that is TOO slow to refresh. But it allows partial flushing of html contents. I.e. Submit button already appears but you don't want your users to click on it prematurely because other parts are still coming. Here I put a javascript the will enable only submit button only after 5 seconds after the page is load fully.
by: | last post by:
Hi all, Has anyone been able to write some custom javascript on the onclick event of submit button to do certain things like disable submit button, only submit form once etc. This was a breeze in 1.1 since I could edit the .js file. Now in 2.0 I can no longer do this. Also, my code would have to be called after all client-side validation was done and was successful. Any ideas? TIA!
by: Bjorn Sagbakken | last post by:
Hello. There maybe an simple answer to this, but sometimes one get a strange blindness when working intensely on one single problem. I'm using ASP.NET 2003, building pages that include 3 user controls (banner, top-menu and sub-menu). The top-menu contains like five asp:buttons. Further down the form there is search field with another asp:button. And I naturally want this button to act as submit button in the sense that when
by: ABC | last post by:
Hi, I have a problem with Double submission in html forms. I am using PHP as the server side scripting language, i have found a means to capture the second form submission while the first form submission is still in-progress. Basically, i can use sessions to check if the first submission is active and reject subsequent submits. ***I do not want to try any client side solution(such as disabling submit button) as hitting F5 on the...
by: Willie | last post by:
Hi All; I have a form with multiple buttons and I would like to disable the buttons after the user clicks on the button to prevent multiple submitions. <input type="submit" name="return1" value="Send To MFG" id="return1" onClick='this.disabled=true;this.form.submit()' > This works but I do not get the return1 value passed to the action script as I do if I just have :
by: Kirthikaiitm | last post by:
Hi, I am totally new to Javascript and i am struggling to work with JScript. Pls help me in this issue. I have form with save,cancel and delete as image buttons. Eg. My code is <input type="image" src=/image/bt_save.jpg....> I want these image buttons to get disabled once i enter the form. On clicking any field in form i want this image button to get enabled.
by: poml | last post by:
Hello, first time posting on thescripts.com, and I'm in dire need of some help. All I want to do is disable the submit button (not the entire form) onClick, and am wondering if this is possible. Here's the current coding: <form enctype="multipart/form-data" action="?id=completeupload" name="submitform" method="POST"> <b>File to Upload:</b>&nbsp;<input name="userfile" size="50" type="file"><br><br> <span class="class3"> <input...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.