469,934 Members | 2,269 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

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 2032
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

Post your reply

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

Similar topics

1 post views Thread by David Bradbury | last post: by
5 posts views Thread by | last post: by
7 posts views Thread by Bjorn Sagbakken | last post: by
15 posts views Thread by ABC | last post: by
8 posts views Thread by Willie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.