473,324 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Submit Form after disabling submit button

91
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 2211
arggg
91
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
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....
6
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...
2
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...
5
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...
7
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...
15
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...
8
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"...
1
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...
9
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. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.