When using the VDS Browser element on a VDS dialog, is there a command for implementing a search within the loaded page? That is, after loading a page, is it possible to search for a certain word within the page? I know there are "Copy" and "Select All" commands, but what about Find?

I have no idea. I have no knowledge of what Commercial Research's future plans for VDS are. Technically, it looks easy to implement a Find, as the web browser component used by the DLL has a Find method. I suppose that it would pop up a Find dialog box, just as if you do Edit, Find in IE._________________The Tech Pro
www.tech-pro.net

However, your idea sounds like a valid solution. Would you happen to be able to determine and post some sample code for this? I am sure all readers on the board could benefit from your knowledge. When using a browser element, it really is important that the user be able to search through the text.

Boo, I'm afraid it is unable to let a javascript notify the VDS script that no matches are found, since javascript can only change local variables and things like that. But it is possible to show a javascript message when nothing is found, which can be done like below:

For your second question: it should be able to make a "search next" command, but for now I don't know how. The code I used came from [ this ] website, so maybe you can try some things yourself? You basicly only have to remove the enters and spaces and put everything in one long row. After that, call the "findinpage()" function with "dialog set,browser1,javascript:findinpage("%%string");"... _________________[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!

:Browsersearch
if @unequal(%2,%%Browsersearch_Oldstring)
if @equal(%3,"NOWARNING")
# This one will display NO warning message when the text is not found.
dialog set,%1,"javascript:var str='"%2"';var txt=window.document.body.createTextRange();var found=txt.findText(str);if (found==true){txt.select();txt.scrollIntoView();}"
else
# While this one does
dialog set,%1,"javascript:var str='"%2"';var txt=window.document.body.createTextRange();var found=txt.findText(str);if (found==true){txt.select();txt.scrollIntoView();}else{window.alert('String not found')}"
end
%%Browsersearch_Oldstring = %2
else
# This will find the next occurance.
dialog set,%1,"javascript:var temp=txt.moveStart('character',1);var found=txt.findText(str);if (found==true){txt.select();txt.scrollIntoView();}"
end
exit

I have a question. Is it possible to fire an event when a new window is trying to be opened while the NONEWWINDOWS style is used with the browser element, just like the <browsername>NAVIGATE event which is fired when people try to navigate while the browser element has the NONAVIGATE style? I would like to "trap" new windows so that I can create a tabbed-browser... _________________[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum