This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > Basic Form to advanced form...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Basic Form to advanced form...
JimmyRiddle99

2004-08-26, 12:18 pm

Ok. I've got a simple, interactive form for a website i am doing. There are
several check-boxes in this form. When a certain one of them is clicked
(place an order) i want a more detailed form to appear. I have seen this
done before but don't know the method.

Any ideas?

JimR99


Murray *TMM*

2004-08-26, 12:18 pm

You can use the ChangeProperty behavior to do something like this quite
easily....

<html>
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
var obj = MM_findObj(objName);
if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
if (theValue == true || theValue == false)
eval("obj."+theProp+"="+theValue);
else eval("obj."+theProp+"='"+theValue+"'");
}
}
//-->
</script>
</head>
<body>
<form name="form1" method="post" action="">
<p>basic1 <input type="text" name="textfield1"></p>
<p>basic 2 <input type="text" name="textfield2"></p>
<p>basic 3 <input type="text" name="textfield3">
<input name="checkbox" type="checkbox"
onClick="MM_changeProp('advanced1','','style.display','inline','DIV')"
value="checkbox">
&lt;- click to see advanced</p>
<p>
<div style="display:none" id="advanced1">advanced
<input type="text" name="textfield" id="advancedText"></div>
</p>
<p>basic 4 <input type="text" name="textfield"></p>
<p>basic 5 <input type="text" name="textfield"></p>
</form>

Create a new page in DW, and replace all the code on the page with this code
(watch the carriage returns in the code).

When the checkbox is checked, the advanced field will appear.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"JimmyRiddle99" <scoobydoo@scooby.com> wrote in message
news:cgfbv8$art$1@forums.macromedia.com...
> Ok. I've got a simple, interactive form for a website i am doing. There
> are
> several check-boxes in this form. When a certain one of them is clicked
> (place an order) i want a more detailed form to appear. I have seen this
> done before but don't know the method.
>
> Any ideas?
>
> JimR99
>
>



Murray *TMM*

2004-08-26, 12:18 pm

You're welcome!

You should have no problems. It's all pretty simple stuff.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"JimmyRiddle99" <scoobydoo@scooby.com> wrote in message
news:cgffg6$f27$1@forums.macromedia.com...
> Thanks Murray! I'll try that and see if i can customize it.
>
> JimR99
>
>



JimmyRiddle99

2004-08-26, 12:18 pm

Thanks Murray! I'll try that and see if i can customize it.

JimR99


JimmyRiddle99

2004-08-26, 12:20 pm


Just a quick question Murray:

Is there a way to make the advanced section hidden again when the check-box
is unchecked? I'm just thinking someone might click it in error.

Thanks Again!

JimR99


Murray *TMM*

2004-08-26, 12:20 pm

Sure - put another check box, and apply the reverse behavior to it.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"JimmyRiddle99" <scoobydoo@scooby.com> wrote in message
news:cghrg7$ep3$1@forums.macromedia.com...
>
> Just a quick question Murray:
>
> Is there a way to make the advanced section hidden again when the
> check-box
> is unchecked? I'm just thinking someone might click it in error.
>
> Thanks Again!
>
> JimR99
>
>



JimmyRiddle99

2004-08-26, 12:20 pm

>put another check box, and apply the reverse behavior to it


Would it work if the behavior was applied to the same check-box, but to
activate when the box is 'un-checked'?

So you accidentally click it, the advanced section appears, you think oops,
click the box again and the advanced section disappears.

JimR99


Murray *TMM*

2004-08-26, 12:20 pm

I'm not sure how you would do that unchecked thing. Two checkboxes is
simple. 8)

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"JimmyRiddle99" <scoobydoo@scooby.com> wrote in message
news:cgi1b2$kpj$1@forums.macromedia.com...
>
>
> Would it work if the behavior was applied to the same check-box, but to
> activate when the box is 'un-checked'?
>
> So you accidentally click it, the advanced section appears, you think
> oops,
> click the box again and the advanced section disappears.
>
> JimR99
>
>



JimmyRiddle99

2004-08-26, 12:21 pm

Oh well. I might re-post + see if anyone else has a solution. Please don't
be offended, i appreciate your help.

I'm just thinking that a checkbox has a value of either true or false
depending on whether it is checked or not, so rather than using 'onClick' i
might be able to use 'if value=True - show advanced1' or 'if value=False -
hide advanced1'. Dunno...???

It's an offical general enquiry/order form for a company you see, so having
a checkbox that says 'place an order' which when clicked reveals the
advanced section and another checkbox that says 'click here if you want to
get rid of the advanced section' doesn't seem very professional.

Thanks for your help though Murray. Apart from the fact i can't get the
advanced section to dissappear, it's ideal!

JimR99


Murray *TMM*

2004-08-26, 12:21 pm

Reloading the page will make the advanced section go away.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"JimmyRiddle99" <scoobydoo@scooby.com> wrote in message
news:cgi7hb$sge$1@forums.macromedia.com...
> Oh well. I might re-post + see if anyone else has a solution. Please don't
> be offended, i appreciate your help.
>
> I'm just thinking that a checkbox has a value of either true or false
> depending on whether it is checked or not, so rather than using 'onClick'
> i
> might be able to use 'if value=True - show advanced1' or 'if value=False -
> hide advanced1'. Dunno...???
>
> It's an offical general enquiry/order form for a company you see, so
> having
> a checkbox that says 'place an order' which when clicked reveals the
> advanced section and another checkbox that says 'click here if you want to
> get rid of the advanced section' doesn't seem very professional.
>
> Thanks for your help though Murray. Apart from the fact i can't get the
> advanced section to dissappear, it's ideal!
>
> JimR99
>
>



Murray *TMM*

2004-08-26, 12:21 pm

I'm sure someone will tell you how to do this.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"JimmyRiddle99" <scoobydoo@scooby.com> wrote in message
news:cgi8pp$pl$1@forums.macromedia.com...
> Yeah, but again, for a professional company, you dont want your users
> having
> to reload the page to do that. For me and you these things are obvious,
> but
> for Joe Bloggs the builder (the company sells and hires aerial access
> platforms/cherry pickers) who hardly uses his computer...
> I am truly shocked at how stupid some users can be, but they are +
> sometimes
> you need to spell everything out to them. I certainly don't want to put a
> note on the page saying 'if you have clicked place an order in error,
> please
> refresh your page using the button at the top or your View menu to remove
> the advanced section' - how amatur is that!!!
> If there is no solution, i'd rather not do it at all than mickey mouse it.
>
> JimR99
>
>



JimmyRiddle99

2004-08-26, 12:21 pm

Yeah, but again, for a professional company, you dont want your users having
to reload the page to do that. For me and you these things are obvious, but
for Joe Bloggs the builder (the company sells and hires aerial access
platforms/cherry pickers) who hardly uses his computer...
I am truly shocked at how stupid some users can be, but they are + sometimes
you need to spell everything out to them. I certainly don't want to put a
note on the page saying 'if you have clicked place an order in error, please
refresh your page using the button at the top or your View menu to remove
the advanced section' - how amatur is that!!!
If there is no solution, i'd rather not do it at all than mickey mouse it.

JimR99


Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews