We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Clone entry with Safecracker

Development and Programming

icebreaker's avatar
icebreaker
50 posts
14 years ago
icebreaker's avatar icebreaker

I want to clone an existing entry. The idea is to load the entry, use JQuery to empty the title and url-title, set hidden fields such as the entry id to zero and submit the revised form as a new entry.

However, it seems Safecracker removes the keyup function on edit (segment_3 not blank). Is it possible to prevent this or work around this behaviour? Where to look?

       
Sam Sullivan's avatar
Sam Sullivan
64 posts
13 years ago
Sam Sullivan's avatar Sam Sullivan

Did you sort this? I used as I describe in the thread below.

http://ellislab.com/forums/viewthread/201672/

       
icebreaker's avatar
icebreaker
50 posts
13 years ago
icebreaker's avatar icebreaker

No – I made two buttons a) To clone b) To translate spaces to underscore and ensure lower case only url-title (does not check for duplicates).

$(‘#clone’).click (function() { var t=$(‘[name=”title”]’).val(); $(‘[name=”title”]’).val(t+”_CLONE”); t=$(‘[name=”url_title”]’).val(); $(‘[name=”url_title”]’).val(t+”_CLONE”); $(‘[name=”entry_id”]’).val(”);
});

$(‘#cpurl’).click (function() { var t=$(‘[name=”title”]’).val().trim().replace(/ /g,’_’).toLowerCase(); $(‘[name=”url_title”]’).val(t); });

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.