Skip to content Skip to sidebar Skip to footer

Revise Bookmarklet To Use The Same Copy From Clipboard To Process The Clipboard Contents And Fill Form

I have found two bookmarlets that can take formatted text from the clipboard and fill a form on another page. This works even cross domain and cross browsers. The problem is that

Solution 1:

The original bookmarklet developer provided the following.. Seems it only works in some IE versions. Hope this helps someone that needs this form filling functionality.

javascript:function%20repop(){var%20j,A="",D,E,F=document.forms,G="",div="~::~",H,FA=[],TA=[],DF=[],DA=[],c;%20%20c=window.clipboardData;wait(3000);%20%20if%20(c)%20{%20%20%20%20H=c.getData('Text');%20%20}%20%20%20%20if%20(!t)%20%20{%20%20%20%20H=window.prompt('Paste:');%20%20}K=H.split("~jdiv~");while(K.length>0){var%20L=K.shift().split(div);mypush(L,FA);}var%20alen=FA.length;for(var%20c=0;c<alen;c++){TA[c]=[];addtypes(FA[c],TA[c]);}for(all%20in%20FA){addObj(FA[all],TA[all]);}for(var%20eff%20in%20TA){for(var%20o%20in%20TA[eff]){for(var%20i%20in%20TA[eff][o].objArr){var%20fl=F[eff].length;for(var%20df=0;df<fl;df++){var%20dff=F[eff][df];var%20taf=TA[eff][o].objArr[i];if(dff.name==taf[1]){if(taf[2].length==0||taf[2].length==undefined){taf[2]="";}dff.value=taf[2];}}}}}}repop();void(null);function%20addObj(obj,ElArr){for(i%20in%20obj){for(var%20e%20in%20ElArr){if(obj[i][0]==ElArr[e].name){ElArr[e].objArr.push(obj[i]);break;}}}}function%20mypush(a,Ar){var%20n=a.shift();if(Ar[n]==undefined){Ar[n]=[];}Ar[n].push(a);}function%20addtypes(a,Ar){for(var%20e%20in%20a){var%20t=a[e][0];if(elemIndexOf(t,Ar)==-1){var%20bob=new%20Elemental(t,[]);Ar.push(bob);}}}function%20elemIndexOf(s,a){var%20ln=a.length;for(var%20x=0;x<ln;x++){if(a[x].name==s){return(x);}}return(-1);}function%20Elemental(name,objArr){this.name=name;this.objArr=objArr;}

Post a Comment for "Revise Bookmarklet To Use The Same Copy From Clipboard To Process The Clipboard Contents And Fill Form"