Menu/List Help!

I would like to create a page with a Menu/List item that makes different things appear once selected in the list. For example, I have a page with a form that will have a menu/list in it for the following “Contact Me Via” options:

Email
Phone
No, Thank you

I would like an “Email” text field to appear when “Email” is selected in the list, and likewise would like a “Phone Number” field to appear when “Phone” is selected in the list. Obviously, selecting “No, Thank you” will not make any additional sections appear.

Possible? How? Thanks in advance.

TB


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You can do this with JavaScript. You can tie an onchange event to a
menu/list that once fired can call a function.

Start off with the menu/list on the page, give it a meaningful name
(in the third pane of the Inspector, not the title in the first,
although it helps to make that meaningful too) and add the options you
want. I would recommend making the Value of the options 0, 1 and 2 and
the Choice should contain the text you want to see in the list.

Now draw a layer where you want the textfield to appear and make a
note of the Title (I’ll call mine contact).

Select the menu/list item again, go to the Item menu and select
Extended. In the dialog that appears click New and enter “onchange” in
the Name field and “setContact(this.value)” in the Value field.

Now go to the Page menu and choose HTML Markup, in the dialog that
appears choose “Before ” from the dropdown menu and paste the
following in the field in the center:

<script type="text/javascript">
	function setContact(value) {
		var contact = document.getElementById('contact');
		switch(value) {
			case("0"):
				contact.innerHTML = "<p style='size:16px'>Phone <input  

name=‘email’ size=30>

";
break;
case(“1”):
contact.innerHTML = “

Email

”;
break;
default:
contact.innerHTML = “”;
break;
}
}

Note that if you call your item you want the textfield to appear in
something different you will need to change the contact in
document.getElementById(‘contact’) to whatever your item is called.

There are of course many other ways to do this, some of them possibly
easier, but because they require JavaScript libraries and each of them
are different it’s easier to explain this way.

Hope this helps,

Joe

On 18 Sep 2009, at 04:26, twb716 wrote:

I would like to create a page with a Menu/List item that makes
different things appear once selected in the list. For example, I
have a page with a form that will have a menu/list in it for the
following “Contact Me Via” options:

Email
Phone
No, Thank you

I would like an “Email” text field to appear when “Email” is
selected in the list, and likewise would like a “Phone Number” field
to appear when “Phone” is selected in the list. Obviously, selecting
“No, Thank you” will not make any additional sections appear.

Possible? How? Thanks in advance.

TB


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options