I am more than just a survey tool : iframe

So 7 months into the year and this is the first post , how bad is that 🙂 … Anyway back on the posting again which is good. At the end of last year i started some posts titled “I am more than just a survey tool” and i covered everything you needed to know about how to design a Menu system. Now the next set of articles will show you the code i use to display content in menu system. This article assumes you have followed the previous examples and you have a menu system like this ,

menu1

with a sub menu of this

menu4

The code we add will be added to the sub menu “Option A”. We will make a function ( MakeIFrame ) that will return some HTML code so our menu code will look like this,

Select Case Option1Menu

	Case = {mBack}
		Goto pMainMenu
	Case = {mOption1_OptionA}
		message.Label.Inserts["MESSAGE"] = MakeIFrame("http://www.smarterDataCollection.com")
	Case = {mOption1_OptionB}

		message.Label.Inserts["MESSAGE"] = "Option B"
End Select

So what will the function do. Well it will point us to another web page and display it in our page with the use of an IFrame. The html Iframe is perfect for this and once you know how to create one you can do many things with them as you will see in later articles. So what does our code look like?

Function MakeIFrame(sURL)
Dim sHTML
sHTML = "<iframe src="" height="240" width="320" frameborder="">"
sHTML = replace(sHTML,"{URL}",sURL)
MakeIFrame = sHTML
End Function

This function is simple , but highlights a powerfull feature that we will use over and over again. Using the replace function we can take a pre-defined html string that we have perhaps designed in out web tool and then replace it with the code that we like , so in our case , we have take the iframe code that will create a windows 1024 pixels wide by 600 high. The window has no border so it will look as if it is part of our original page and it will show the URL that we pass into it. After the replace function has worked we will end up with a string like this,

""

And when we run the code , we will see our page connected to our menu system.

iframe

And that is it for this post , but whats next? Well , the use of an iframe is good, but how good , showing a static page is ok , but what about surveys , or forms to collect data , how can we do that. If we use a survey , how can we keep calling the same record? All these questions will be answered in my next post , so watch this space.

1 thought on “I am more than just a survey tool : iframe”

Leave a Comment

%d bloggers like this: