docs: function attachMosaic() {
  		// Check for form errors
  		if(undefined === $("#mosaicAmount").val() || !nem.utils.helpers.isTextAmountValid($("#mosaicAmount").val())) return alert('Invalid amount !');
  		if(!$("#namespaceId").val() || !$("#mosaicName").val()) return alert('Missing parameter !');
  
  		// If not XEM, fetch the mosaic definition from network
  		if($("#mosaicName").val() !== 'xem') {
  			nem.com.requests.namespace.mosaicDefinitions(endpoint, $("#namespaceId").val()).then(function(res) {
  
  				// Look for the mosaic definition(s) we want in the request response (Could use ["eur", "usd"] to return eur and usd mosaicDefinitionMetaDataPairs)
  				var neededDefinition = nem.utils.helpers.searchMosaicDefinitionArray(res.data, [$("#mosaicName").val()]);
  
  				// Get full name of mosaic to use as object key
  				var fullMosaicName  = $("#namespaceId").val() + ':' + $("#mosaicName").val();
  
  				// Check if the mosaic was found
  				if(undefined === neededDefinition[fullMosaicName]) return alert("Mosaic not found !");
  				
  				// Set mosaic definition into mosaicDefinitionMetaDataPair
  				mosaicDefinitionMetaDataPair[fullMosaicName] = {};
  				mosaicDefinitionMetaDataPair[fullMosaicName].mosaicDefinition = neededDefinition[fullMosaicName];
  
  				// Now we have the definition we can calculate quantity out of user input
  				var quantity = nem.utils.helpers.cleanTextAmount($("#mosaicAmount").val()) * Math.pow(10, neededDefinition[fullMosaicName].properties[0].value);
  
  				// Create a mosaic attachment
  				var mosaicAttachment = nem.model.objects.create("mosaicAttachment")($("#namespaceId").val(), $("#mosaicName").val(), quantity);
  
  				// Push attachment into transaction mosaics
  				transferTransaction.mosaics.push(mosaicAttachment);
  
  				// Calculate back the quantity to an amount to show in the view. It should be the same as user input but we double check to see if quantity is correct.
  				var totalToShow = nem.utils.format.supply(quantity, {"namespaceId": $("#namespaceId").val(), "name": $("#mosaicName").val()}, mosaicDefinitionMetaDataPair)[0] + '.' + nem.utils.format.supply(quantity, {"namespaceId": $("#namespaceId").val(), "name": $("#mosaicName").val()}, mosaicDefinitionMetaDataPair)[1];
  
  				// Push mosaic to the list in view
  				$("#mosaicList").prepend('<li>'+ totalToShow +' <small><b>'+  $("#namespaceId").val() + ':' + $("#mosaicName").val() +'</b></small> </li>');
  
  				// Update the transaction fees in view
  				updateFee();
  			}, 
  			function(err) {
  				alert(err);
  			});
  		} else {
  			// Calculate quantity from user input, XEM divisibility is 6
  			var quantity = nem.utils.helpers.cleanTextAmount($("#mosaicAmount").val()) * Math.pow(10, 6);
  
  			// Create a mosaic attachment
  			var mosaicAttachment = nem.model.objects.create("mosaicAttachment")($("#namespaceId").val(), $("#mosaicName").val(), quantity);
  
  			// Push attachment into transaction mosaics
  			transferTransaction.mosaics.push(mosaicAttachment);
  
  			// Calculate back the quantity to an amount to show in the view. It should be the same as user input but we double check to see if quantity is correct.
  			var totalToShow = nem.utils.format.supply(quantity, {"namespaceId": $("#namespaceId").val(), "name": $("#mosaicName").val()}, mosaicDefinitionMetaDataPair)[0] + '.' + nem.utils.format.supply(quantity, {"namespaceId": $("#namespaceId").val(), "name": $("#mosaicName").val()}, mosaicDefinitionMetaDataPair)[1];
  
  			// Push mosaic to the list in view
  			$("#mosaicList").prepend('<li>'+ totalToShow +' <small><b>'+  $("#namespaceId").val() + ':' + $("#mosaicName").val() +'</b></small> </li>');
  
  			// Update the transaction fees in view
  				updateFee();
  		}
  	}