Javascript (jQuery) markup for saef in expression engine


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type="text/javascript">
  2. // <![CDATA[
  3. $(document).ready( function() {
  4.  
  5. //URL Title js
  6. $("input#title").keyup( function() {
  7. var titleText = $("input#title").val().replace(/ /g,"_").toLowerCase();
  8. $("input#url_title").val(titleText);
  9. });
  10.  
  11. //Safecracker File js
  12. $(".safecracker_file_undo_button").css("display", "none");
  13. $(".safecracker_file_remove_button").click( function() {
  14. $(".safecracker_file_input input").removeAttr("disabled");
  15. $(".safecracker_file_thumb").hide();
  16. $(".safecracker_file_undo_button").show();
  17. $(".safecracker_file_remove_button").hide();
  18. var value = $(".safecracker_file_hidden input").val();
  19. $(".safecracker_file_placeholder_input input").val(value);
  20. $(".safecracker_file_hidden input").val("NULL");
  21. return false;
  22. });
  23. $(".safecracker_file_undo_button").click( function() {
  24. $(".safecracker_file_input input").attr("disabled","disabled");
  25. $(".safecracker_file_thumb").show();
  26. $(".safecracker_file_undo_button").hide();
  27. $(".safecracker_file_remove_button").show();
  28. var value2 = $(".safecracker_file_placeholder_input input").val();
  29. $(".safecracker_file_hidden input").val(value2);
  30. $(".safecracker_file_placeholder_input input").val("NULL");
  31. ;return false;
  32. });
  33. });
  34. // ]]>
  35. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.