Drawing a dropdown box in milonic

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Idee
Beginner
Beginner
Posts: 5
Joined: Fri Oct 28, 2005 1:45 am

Drawing a dropdown box in milonic

Post by Idee »

Hi

In my top milonic navigation, one of the items in the milonic has to be drop down <select box. I have to get the items from the database. I was able to draw a <select box using the hardcoded values but wasn't able to do it when looping through a record set.

with(milonic=new menuname("topmenu"))
{
style=topmenuStyle;top=2;left=2;margin=0;menuwidth="100%";alwaysvisible=1;orientation="horizontal";position="absolute";
aI('text=&nbsp;Main&nbsp;;padding=4;url=javascript:redirecttomain();;');

aI('text=<select name=test class=selectbox onChange=selvalue(this.value)>' + while (!record.EOF) + '{ <option value=' + record(0) + '>' + record(1) + '&nbsp;' + record.movenext() + '}</select>;padding=4;type=form;margin=2;itemheight=18;');

This one is not working... don't know where to put while(!record.EOF? If I put it ouside aI(, then it draws three seperate items...

Please help me I need an urgent help!!! Thanks
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I don't know if any of the following will help, forms are not my thing :)

http://support.milonic.com/demos/select_box/index.htm

http://rimea.org/forms/allstate/test1.html

Ruth
Idee
Beginner
Beginner
Posts: 5
Joined: Fri Oct 28, 2005 1:45 am

Post by Idee »

Thanks Ruth, first link might work for me. I will give it a go.
Shap5202
Super Advanced
Super Advanced
Posts: 62
Joined: Thu Sep 29, 2005 2:36 pm

Post by Shap5202 »

what technology are you using? I'm guessing ASP/.NET?

If it were in JSP what you were looking for is probably...

Code: Select all

with(milonic=new menuname("topmenu"))
{
style=topmenuStyle;top=2;left=2;margin=0;menuwidth="100%";alwaysvisible=1;orientation="horizontal";position="absolute";
aI('text=&nbsp;Main&nbsp;;padding=4;url=javascript:redirecttomain();;');

aI('text=<select name=test class=selectbox onChange=selvalue(this.value)>'
<% while(Looping over records){ %>
       <option value='<%= record(0) %>'><%= record(1) %>&nbsp;
<% 
     record.movenext()
} %>
</select>;padding=4;type=form;margin=2;itemheight=18;'); 

Again, this is some bastardized version of JSP/.NET/whatever of what you might be looking for, but maybe it will help?
Idee
Beginner
Beginner
Posts: 5
Joined: Fri Oct 28, 2005 1:45 am

Post by Idee »

I am writing it within a html page and using javascript and vbscript in there.

But you have suggested made me think that if I create a string with the whole script then use that string in aI(sstr);, it should work.

Thanks
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

As I noted before, forms are not my thing, and you can add database and just about everything else :lol: However, I posted that page for you, and now I've finally found the original post which talks about some script doing something to a form from a database and includes a script Andy wrote to interact with that in a form.

It probably is not anything to do with what you're doing, but since I don't really know what you're doing, I thought I'd drop the link for the original post and creation of that function, just in case.

viewtopic. ... 9712#19712

And, this is a fix that was done when the menu was upgraded at 5.735 I think

viewtopic. ... 2822#32822

Just ignore it if it's not anything remotely to do with this topic :)

Ruth
Post Reply