Guest User

Untitled

a guest
Oct 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. //alert('entire page reloaded and ready');
  4. var selectedPlan = window.location.hash.substr(1);
  5. $("#edit-attributes-43").live("change", function(){
  6. if ($(this).val() !== selectedPlan) {
  7. window.location = window.location.href.replace(/#.*$/, '') + '#' + $(this).val();
  8. window.location.reload();
  9. $('form').clearForm()
  10. }
  11. });
  12. });
  13. </script>
  14. <script type="text/javascript">
  15. $.fn.clearForm = function() {
  16. return this.each(function() {
  17. var type = this.type, tag = this.tagName.toLowerCase();
  18. if (tag == 'form')
  19. return $(':input',this).clearForm();
  20. if (type == 'text' || type == 'password' || tag == 'textarea')
  21. this.value = '';
  22. else if (type == 'checkbox' || type == 'radio')
  23. this.checked = false;
  24. else if (tag == 'select')
  25. this.selectedIndex = -1;
  26. });
  27. };
  28. </script>
Add Comment
Please, Sign In to add comment