| View previous topic :: View next topic |
| Author |
Message |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Tue Sep 08, 2009 3:52 pm Post subject: Spec Form Show/Hide/Toggle Methods w/Drop Down Menu Option |
|
|
When selecting Iowa the Address 1 label and City lable and variable spec show than when I select Other the address 1 variable spec show.
When I go back to select Iowa nothing show (which is what it should be) and than when I select Other the Address and City label and variable spec show? Below are my script below.
What I'm trying to accomplish is when the customer select "Iowa" nothing show but when they select "Other" the variable spec Address1 and City show along with the label. this is kind of similar to my check box feature show/hide/toggle methods except i am using the drop down feature.
Item: BC-01 TESTING
Description: BC-01 TESTING
Buyer: Mary Greeley Medical Center
Edit HTML Tab:
<p><strong>Select Location: </strong> [[Address]] <br />
<span id="add1">Address 1 </span>[[OtherAddress1]] <br />
<span id="city">City </span>[[OtherCity]]</p>
Advanced Scripting Tab:
spec['OtherAddress1'].hide();
get('add1').hide();
spec['OtherCity'].hide();
get('city').hide();
spec['Address'].onchange = function(){
var choices = { "Iowa" : "Iowa", "Other" : "Other" }
if (this.selectedText() != "Iowa")
spec['OtherAddress1'].toggle();
get('add1').toggle();
spec['OtherCity'].toggle();
get('city').toggle();}
spec['OtherAddress1'].onselect = function(){
get('add1').hide();
if (this.value.length > 0)
get('add1').show();}
Any help is greatly appreciated.
Thanks in advanced.
Last edited by mvang on Wed Sep 09, 2009 11:23 am; edited 1 time in total |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Sep 09, 2009 9:01 am Post subject: |
|
|
Another method that works but the <pan> is not showing.
HTML
<p><strong>Select Location: </strong> [[Address]] <br>
<span id="add1">Address 1 </span>[[OtherAddress1]] <br />
</p>
Advanced Script
spec['OtherAddress1'].hide();
get('add1').hide();
spec['Address'].onchange = function(){
var choices = { "Iowa" : "Iowa", "Other" : "Other" }
if
(this.selectedText() != "Iowa")
spec['OtherAddress1'].show();
else
spec['OtherAddress1'].hide();}
Last edited by mvang on Wed Sep 09, 2009 11:24 am; edited 2 times in total |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Wed Sep 09, 2009 10:49 am Post subject: Try this. Hard to understand your needs. |
|
|
<div><strong>Select Location: </strong> [[Address]]</div>
<div><span>Address 1 </span>[[OtherAddress1]]</div>
spec['Address'].onchange = function() {
get('OtherAddress').hide();
if (this.selectedText() == 'Other')
get('OtherAddress').show();
}; _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Sep 09, 2009 11:06 am Post subject: |
|
|
Thank you for the reply.
I copy and paste the code.
Blank selection include the span "Address" and variable spec "OtherAddress1".
"Iowa" selection include the span "Address"
"Other" selection include both "Address" and variable spec "OtherAddress1".
Is it possible to only show the "Address" and variable spec "OtherAddress1" when select "Other" and have nothing show when the blank (1st selection) or Iowa is selected.
Thank you in advanced.
MV |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Wed Sep 09, 2009 11:10 am Post subject: |
|
|
| mvang wrote: | Thank you for the reply.
I copy and paste the code.
Blank selection include the span "Address" and variable spec "OtherAddress1".
"Iowa" selection include the span "Address"
"Other" selection include both "Address" and variable spec "OtherAddress1".
Is it possible to only show the "Address" and variable spec "OtherAddress1" when select "Other" and have nothing show when the blank (1st selection) or Iowa is selected.
Thank you in advanced.
MV |
Of course. Just change what your hiding/showing. I struggle to understand what you are specifically asking for. _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Wed Sep 09, 2009 11:13 am Post subject: |
|
|
I'm trying to hide the spec control name "Address" when selecting Iowa or the blank options.
spec['OtherAddress1'].hide(); *add to remove variable spec but the spec control name "Address" still show
spec['Address'].onchange = function() {
get('OtherAddress1').hide();
if (this.selectedText() == 'Other')
get('OtherAddress1').show(); };
Previous I added an Span ID:
HTML
<span id="add1">Address 1 </span>[[OtherAddress1]] <br />
ADVANCED SCRIPT
spec['OtherAddress1'].show();
get('add1').show();
MV |
|
| Back to top |
|
 |
Steve
Joined: 17 Jan 2008 Posts: 337
|
Posted: Wed Sep 09, 2009 12:31 pm Post subject: |
|
|
| mvang wrote: | I'm trying to hide the spec control name "Address" when selecting Iowa or the blank options.
spec['OtherAddress1'].hide(); *add to remove variable spec but the spec control name "Address" still show
spec['Address'].onchange = function() {
get('OtherAddress1').hide();
if (this.selectedText() == 'Other')
get('OtherAddress1').show(); };
Previous I added an Span ID:
HTML
<span>Address 1 </span>[[OtherAddress1]] <br>
ADVANCED SCRIPT
spec['OtherAddress1'].show();
get('add1').show();
MV |
hide is a function. It has to have a target. If it's the spec then you use the spec reference. If it's a DOM element you use the dom element reference.
spec['Address'].hide() or get('add1').hide() _________________ Steve
You can read about other advanced tech topics on the http://www.insightsfour51.com/?cat=3 |
|
| Back to top |
|
 |
mvang
Joined: 29 Jan 2008 Posts: 80
|
Posted: Mon Sep 21, 2009 11:47 am Post subject: |
|
|
The spec control name "Address 1" is still showing when selecting Iowa or the default blank options.
HTML
<div><strong>Select Location: </strong> [[Address]]</div>
<div><span id="add1">Address 1 </span>[[OtherAddress1]]</div>
Advanced Script
spec['OtherAddress1'].hide();
get('add1').hide();
spec['Address'].onchange = function() {
if (this.selectedText() == 'Iowa')
get('OtherAddress1').hide();
get('add1').hide();
if (this.selectedText() == 'Other')
get('OtherAddress1').show();
get('add1').show();
};
Item# BC01
Description: Drop Down Option
Catelog: Business Card
Buyer: Maiton Testing Site
Thank you in advanced.
MV |
|
| Back to top |
|
 |
|