Advertisement
bowenac

Untitled

Jan 10th, 2014
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Main Original Upload
  2. <script language="JavaScript">
  3. jQuery(document).ready(function() {
  4. jQuery('#upload_button').click(function() {
  5. formfield = jQuery('#upload').attr('name');
  6. tb_show('', 'media-upload.php?type=image&TB_iframe=true');
  7. return false;
  8. });
  9. window.send_to_editor = function(html) {
  10. imgurl = jQuery('img',html).attr('src');
  11. jQuery('#upload').val(imgurl);
  12. tb_remove();
  13. }
  14. });
  15. </script>
  16. <input id="upload" type="text" size="36" name="upload" value="<?php echo $gearimage; ?>" />
  17. <input id="upload_button" type="button" value="Upload Image" />
  18.  
  19.  
  20. // Edit The Upload
  21. <script language="JavaScript">
  22. jQuery(document).ready(function() {
  23. jQuery('#upload_image_button<?php echo $chores->id?>').click(function() {
  24. formfield = jQuery('#upload_image<?php echo $chores->id?>').attr('name');
  25. tb_show('', 'media-upload.php?type=image&TB_iframe=true');
  26. return false;
  27. });
  28. window.send_to_editor = function(html) {
  29. imgurl = jQuery('img',html).attr('src');
  30. jQuery('#upload_image<?php echo $chores->id?>').val(imgurl);
  31. tb_remove();
  32. }
  33. });
  34. </script>
  35.  
  36. <input id="upload_image<?php echo $chores->id?>" type="text" size="36" name="upload_image" value="<?php echo $chores->image;?>" />
  37. <input id="upload_image_button<?php echo $chores->id?>" type="button" value="Upload Image" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement