Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:17
Drawing a dropdown box in milonic
Poster: Idee
Dated: Wednesday January 18 2006 - 21:49:11 GMT
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= Main ;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) + ' ' + 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
Poster: Ruth
Dated: Wednesday January 18 2006 - 23:04:29 GMT
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
Poster: Idee
Dated: Thursday January 19 2006 - 0:08:18 GMT
Thanks Ruth, first link might work for me. I will give it a go.
Poster: Shap5202
Dated: Thursday January 19 2006 - 16:06:02 GMT
what technology are you using? I'm guessing ASP/.NET?
If it were in JSP what you were looking for is probably...
Code:
with(milonic=new menuname("topmenu"))
{
style=topmenuStyle;top=2;left=2;margin=0;menuwidth="100%";alwaysvisible=1;orientation="horizontal";position="absolute";
aI('text= Main ;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) %>
<%
record.movenext()
} %>
</select>;padding=4;type=form;margin=2;itemheight=18;');
{
style=topmenuStyle;top=2;left=2;margin=0;menuwidth="100%";alwaysvisible=1;orientation="horizontal";position="absolute";
aI('text= Main ;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) %>
<%
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?
Poster: Idee
Dated: Thursday January 19 2006 - 19:33:49 GMT
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
Poster: Ruth
Dated: Thursday January 19 2006 - 20:22:01 GMT
Hi,
As I noted before, forms are not my thing, and you can add database and just about everything else 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.
http://www.milonic.com/forum/viewtopic. ... 9712#19712
And, this is a fix that was done when the menu was upgraded at 5.735 I think
http://www.milonic.com/forum/viewtopic. ... 2822#32822
Just ignore it if it's not anything remotely to do with this topic
Ruth