473,706 Members | 3,978 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>
  2.  
  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">
  24.  
  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>
  51.  
  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>
  75.  
Mar 28 '08 #1
1 2247
arggg
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

1
5076
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...
6
11400
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...
2
3818
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.
5
2645
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!
7
2082
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
15
4955
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...
8
12097
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 :
1
1593
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.
9
7140
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...
0
8779
marktang
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...
0
8695
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9282
Oralloy
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...
1
9048
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,...
0
8987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4445
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...
0
4708
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3142
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2089
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.