We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 867
    • 241 Posts
    Hi everyone,

    I’m trying to add some fields to bookmarlet of the snippet favoritelinks http://modxcms.com/forums/index.php/topic,11812.msg80476.html#msg80476

    in the favoritelinks.js I put new lines following the ones that exist (i’m don’t know js) :
    But it makes no change (even for the css beeing called for the form/bookmarlet generated by the js)

    Firebug tell me that dlgInput.setAttribute(’name’, ’intro’); is not defined, but i don’t why.. ? huh

    dlgRating = document.createElement('div');
    		dlgLabel = document.createElement('label');
    		dlgLabel.setAttribute('for', 'rating');
    		dlgLabel.appendChild(document.createTextNode('Rating:'));
    		dlgInput = document.createElement('input');
    		dlgInput.setAttribute('type', 'text');
    		dlgInput.setAttribute('name', 'rating');
    		dlgInput.className = 'dlgFavLinksOpt';
    		dlgInput.value = '';
    		dlgDesc = document.createElement('em');
    		dlgDesc.appendChild(document.createTextNode('(optional)'));
    	dlgRating.appendChild(dlgLabel);
    	dlgRating.appendChild(dlgInput);
    	dlgRating.appendChild(dlgDesc);
    	dlgFieldset.appendChild(dlgRating);
    dlgRating = document.createElement('div');
    		dlgLabel = document.createElement('label');
    		dlgLabel.setAttribute('for', 'intro');
    		dlgLabel.appendChild(document.createTextNode('Intro'));
    		dlgInput = document.createElement('input');
    		dlgInput.setAttribute('type', 'text');
    		dlgInput.setAttribute('name', 'intro');



    Thanks in advance for any help !

    In the Html i’ve got this for the bookmarlet link
    <a href="javascript:var bkmkletBase=’http://127.0.0.1/restelakaz/’;var bkmkletLanding=’index.php?id=51&posted=1’;s=document.createElement(’script’);s.type=’text/javascript’;s.src=bkmkletBase+’assets/snippets/FavoriteLinksForm/bookmarklet/favlinks.js’;void(document.body.appendChild(s));">Add Favorite Link</a>