Hello, I am trying to make a site (surprise !) I have a select box and when you choice something in that, a new selectbox should be displayed. Now my problem is that I don't now how the action"script" I have defined in my form-tag recieves the value from the select box. Is there any examples/how-to's anywhere ? Regards, Gitte
On 28 Mar 2001 18:42:41 +0200, Gitte Wange wrote:
Hello, I am trying to make a site (surprise !) I have a select box and when you choice something in that, a new selectbox should be displayed. Now my problem is that I don't now how the action"script" I have defined in my form-tag recieves the value from the select box.
Is there any examples/how-to's anywhere ?
Try a javascript list.
Hello again, I got a lot of replys to my problem but they all just said: Solve it by a JavaScript. Well ... okay. Anyone who has any examples ? Because JavaScript is a big world. Regards, Gitte On 28 Mar 2001 18:42:41 +0200, Gitte Wange wrote:
Hello, I am trying to make a site (surprise !) I have a select box and when you choice something in that, a new selectbox should be displayed. Now my problem is that I don't now how the action"script" I have defined in my form-tag recieves the value from the select box.
Is there any examples/how-to's anywhere ?
Regards, Gitte
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
I got a lot of replys to my problem but they all just said: Solve it by a JavaScript. Well ... okay. Anyone who has any examples ? Because JavaScript is a big world.
you have to take a look at the DOM (document object model) which tells you where you can find the form and its values in the document tree. take a look at http://www.webreference.com/dhtml/ or http://javascript.internet.com/forms/ and http://www.w3.org this seems close to what you want to do anyway .. http://javascript.internet.com/forms/auto-drop-down.html oliver
On 30 Mar 2001 11:37:39 +0200, Oliver Frommel wrote:
I got a lot of replys to my problem but they all just said: Solve it by a JavaScript. Well ... okay. Anyone who has any examples ? Because JavaScript is a big world.
you have to take a look at the DOM (document object model) which tells you where you can find the form and its values in the document tree. take a look at http://www.webreference.com/dhtml/ or http://javascript.internet.com/forms/ and http://www.w3.org
this seems close to what you want to do anyway .. http://javascript.internet.com/forms/auto-drop-down.html
Well it looks like something I could use - expect I can't file in my selections that way ! I need to get my selections from a database ... Regards, Gitte
Hi! Below is my old (and probably inclomplete) code. Untested. Std disclaimer :) On 30 Mar 2001, Gitte Wange wrote:
I got a lot of replys to my problem but they all just said: Solve it by a JavaScript. Well ... okay. Anyone who has any examples ? Because JavaScript is a big world.
Regards, Gitte
On 28 Mar 2001 18:42:41 +0200, Gitte Wange wrote:
Hello, I am trying to make a site (surprise !) I have a select box and when you choice something in that, a new selectbox should be displayed. Now my problem is that I don't now how the action"script" I have defined in my form-tag recieves the value from the select box.
Is there any examples/how-to's anywhere ?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title><!--#var title--></title> <!--#if "id == -1"--> <SCRIPT language="JavaScript"> <!-- <!--#in cities--> array<!--#var sequence-index--> = new Array(<!--#in "regions[_['sequence-item']]"--> new Array(<!--#if sequence-key--><!--#var sequence-key--><!--#else -->0<!--#/if sequence-key-->, <!--#if sequence-item-->"<!--#var sequence-item-->"<!--#else -->"-----"<!--#/if sequence-item-->)<!--#unless sequence-end-->, <!--#/unless sequence-end--> <!--#/in -->); <!--#/in cities--> function updateMenu2(select) { array = eval("array" + select.selectedIndex) region = select.form.region region_options = region.options region_options.length = array.length index_set = 0 for (i = 0; i < array.length; i++) { region_array = array[i] region_options[i] = new Option(region_array[1], region_array[0]) if (region_array[0] == <!--#var id_region-->) { region.selectedIndex = i index_set = 1 } } if (!index_set) { region.selectedIndex = 0 } } // --> </SCRIPT> <!--#/if --> <HEAD> <body bgcolor="#FFFFFF" text="#000000" leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 link="#003265" vlink="#003265" alink="#003265" <!--#if "id == -1"--> onLoad="updateMenu2(document.c2.city)" <!--#/if -->
<!--#if "id == -1"--> <H3>New</H3> <!--#else --> <H3>Edit <!--#var id--></H3> <!--#/if --> <FORM name="c2" action="edit-constr.py" method="POST"> <INPUT type="hidden" name="id" value="<!--#var id-->"> <TABLE> <TR> <TH>City</TH> <!--#if "id == -1"--> <TD> <SELECT name="city" onChange="updateMenu2(this)"> <!--#in cities--> <OPTION value="<!--#var sequence-key-->"<!--#if "_['sequence-key'] == id_city"--> selected<!--#/if -->><!--#var sequence-item--> <!--#/in cities--> </SELECT> </TD> <!--#else --> <TD><!--#var city--></TD> <!--#/if --> </TR> <TR> <TH>Region</TH> <!--#if "id == -1"--> <TD> <SELECT name="region"> <OPTION>long junk to preserve space </SELECT> </TD> <!--#else --> <TD><!--#var region--></TD> <!--#/if --> </TR> <TR> <TH> </TH> <TD> <!--#if "_['sequence-item'][1]"--> <INPUT type="submit" name="Edit" value="Edit"> <!--#else --> <INPUT type="submit" name="New" value="New"> <!--#/if --> </TD> </TR> </TABLE> </FORM> <!--#/in sides--> <!--#/if sides--> </body> </html> Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
participants (5)
-
Bill Anderson -
Gitte Wange -
Gitte Wange -
Oleg Broytmann -
Oliver Frommel