I am trying to write a javascript bookmarklet that will pull data from a webpage. The webpage in question comes pre-filled with info. I know what element and form numbers are tied to the field that I want to pull data from. How would I write a bookmarklet to harvest the data? The bookmarklet would be used in conjunction with a scripting program but I have a way to get the data from javascript into the script so don't worry about that part.
I have found this code elsewhere... it does what I need but it also provides too much info:
- javascript:function ROIoiW(){var i=0,j,D,E,F=document.forms,DD="",m,M; while(i<F.length){E=F[i].elements;for(j=0;j<E.length;j++){ D=E[j];m=i+'/'+j+'/'+D.type+'-'+E.name+'-'+D.name+'-'+D.value+'\n'; M=M+m;DD=DD+m+'<br>'}i++} document.write(DD);}ROIoiW();void(null)
this displays form/element/description-value. All I need is a fucntion that will return a value for a specified form and element.
Can someone help please?