i am using aviary photo editor and when someone finish editing and click on save so i want to get the link of saved image when onsave function get executed and want to get the new generated image link in the input field as :
<html>
<body onSave="autofill();">
<input type="text" name="name_textbox" id="id_textbox" />
<script type="text/javascript" language="JavaScript">
function autofill(){
var object = document.getElementsByName('name_textbox');
object.item(0).value="Autofill successful.";
}</script>
</body>
</html>
and here is the aviary photo editor code onsave function code :
<script type='text/javascript'>var featherEditor = new Aviary.Feather({
apiKey: 'ceegvx4siylhayrr',
apiVersion: 3,
theme: 'dark', // Check out our new 'light' and 'dark' themes!
tools: 'all',
appendTo: '',
onSave: function(imageID, newURL) {
var img = document.getElementById(imageID);
img.src = newURL;
},
onError: function(errorObj) {
alert(errorObj.message);
}
});
function launchEditor(id, src) {
featherEditor.launch({
image: id,
url: src
});
return false;
}
</script>
<div id='injection_site'></div>
<img id='image1' src='http://images.aviary.com/imagesv5/feather_default.jpg'/>
<!-- Add an edit button, passing the HTML id of the image and the public URL of the image->
<p><input type='image' src='http://images.aviary.com/images/edit-photo.png' value='Edit photo' onclick="return launchEditor('image1', 'http://images.aviary.com/imagesv5/feather_default.jpg');" /></p>