Re: Javascript question

2011-03-14 Thread Carl Von Stetten

Is it possible that the click event is actually happening on the TD 
elements and not the TR?  You might try attaching the click event to the 
parent table (so it only binds to one element) and take advantage of 
event bubbling.  Use the event.target attribute to get to the row:

$(#mytable).click(function(event) {
 var $target = event.target;
 if ( $target.is(td) ) {
 row_id = $target.parent().attr(id);
 } else if ( $target.is(tr) ) {
 row_id = $target.attr(id);
 }
 rest of your code here
});

HTH,
Carl

On 3/13/2011 7:43 AM, fun and learning wrote:
 Hi All - I am trying to get the following working. It seemed to work 
 initially, but somehow it stopped working

 I have a row like below

 tr id=row_1_4_2009_abc class=rowclick
 td/td
 /tr

 I am using jquery to get the id on click of a row:

 $(.rowclick).click(function() {
var row_id = $(this).attr(id);
var getAttributes = row_id.split(_);
var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ + 
 getAttributes[3] + _ + getAttributes[4];
var new_row_id = document.getElementById(new_row_ + setCommonAttr).value;
 });

 Can anyone let me know what is wrong with the above code. Tried different 
 options but with no success



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343008
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Javascript question

2011-03-13 Thread fun and learning

Hi All - I am trying to get the following working. It seemed to work initially, 
but somehow it stopped working

I have a row like below

tr id=row_1_4_2009_abc class=rowclick
   td/td
/tr

I am using jquery to get the id on click of a row:

$(.rowclick).click(function() {
  var row_id = $(this).attr(id);
  var getAttributes = row_id.split(_);
  var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ + 
getAttributes[3] + _ + getAttributes[4];
  var new_row_id = document.getElementById(new_row_ + setCommonAttr).value;
});

Can anyone let me know what is wrong with the above code. Tried different 
options but with no success



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342959
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Javascript question

2011-03-13 Thread fun and learning

Hi All - I am trying to get the following working. It seemed to work initially, 
but somehow it stopped working

I have a row like below

tr id=row_1_4_2009_abc class=rowclick
   td/td
/tr

I am using jquery to get the id on click of a row:

$(.rowclick).click(function() {
  var row_id = $(this).attr(id);
  var getAttributes = row_id.split(_);
  var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ + 
getAttributes[3] + _ + getAttributes[4];
  var new_row_id = document.getElementById(new_row_ + setCommonAttr).value;
});

Can anyone let me know what is wrong with the above code. Tried different 
options but with no success



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342960
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Javascript question

2011-03-13 Thread Jake Churchill

Look into jQuery's .each() method.  It helps in loopin over things like that

-Jake

Sent from my Droid
On Mar 13, 2011 9:51 AM, fun and learning funandlrnn...@gmail.com wrote:

 Hi All - I am trying to get the following working. It seemed to work
initially, but somehow it stopped working

 I have a row like below

 tr id=row_1_4_2009_abc class=rowclick
 td/td
 /tr

 I am using jquery to get the id on click of a row:

 $(.rowclick).click(function() {
 var row_id = $(this).attr(id);
 var getAttributes = row_id.split(_);
 var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ +
getAttributes[3] + _ + getAttributes[4];
 var new_row_id = document.getElementById(new_row_ +
setCommonAttr).value;
 });

 Can anyone let me know what is wrong with the above code. Tried different
options but with no success



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342961
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Javascript question

2011-03-13 Thread Russ Michaels

it looks like you are using the classname instead of the object ID.
normally the $() function is fer getting a reference to a obejct by its ID.

$(.rowclick)
shouldn't this be
$(row_1_4_2009_abc)




On Sun, Mar 13, 2011 at 3:29 PM, Jake Churchill reyna...@gmail.com wrote:


 Look into jQuery's .each() method.  It helps in loopin over things like
 that

 -Jake

 Sent from my Droid
 On Mar 13, 2011 9:51 AM, fun and learning funandlrnn...@gmail.com
 wrote:
 
  Hi All - I am trying to get the following working. It seemed to work
 initially, but somehow it stopped working
 
  I have a row like below
 
  tr id=row_1_4_2009_abc class=rowclick
  td/td
  /tr
 
  I am using jquery to get the id on click of a row:
 
  $(.rowclick).click(function() {
  var row_id = $(this).attr(id);
  var getAttributes = row_id.split(_);
  var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ +
 getAttributes[3] + _ + getAttributes[4];
  var new_row_id = document.getElementById(new_row_ +
 setCommonAttr).value;
  });
 
  Can anyone let me know what is wrong with the above code. Tried different
 options but with no success
 
 
 
 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342962
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Javascript question

2011-03-13 Thread Michael Grant

$(.rowclick) is completely acceptable. It will just add the function to
all elements with that class name, which I assume is that the OP is looking
for.

OP: In the code you pasted what part isn't working exactly? All you are
doing is setting some variables. I don't see in the code where any actually
does anything other than populate variables which are all var'd to the
function, they aren't global. Also, can you confirm that there is an element
with the id of  new_row_1_4_2009_abc and a parameter called value?

I guess it might help if we knew what exactly you were trying to accomplish
in order to determine if it's working or not.

On a side note, since you are using jQuery I'd recommend the jQuery
$(#idname).val() instead of document.getElementById(idname).value.


On Sun, Mar 13, 2011 at 12:17 PM, Russ Michaels r...@michaels.me.uk wrote:


 it looks like you are using the classname instead of the object ID.
 normally the $() function is fer getting a reference to a obejct by its ID.

 $(.rowclick)
 shouldn't this be
 $(row_1_4_2009_abc)




 On Sun, Mar 13, 2011 at 3:29 PM, Jake Churchill reyna...@gmail.com
 wrote:

 
  Look into jQuery's .each() method.  It helps in loopin over things like
  that
 
  -Jake
 
  Sent from my Droid
  On Mar 13, 2011 9:51 AM, fun and learning funandlrnn...@gmail.com
  wrote:
  
   Hi All - I am trying to get the following working. It seemed to work
  initially, but somehow it stopped working
  
   I have a row like below
  
   tr id=row_1_4_2009_abc class=rowclick
   td/td
   /tr
  
   I am using jquery to get the id on click of a row:
  
   $(.rowclick).click(function() {
   var row_id = $(this).attr(id);
   var getAttributes = row_id.split(_);
   var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ +
  getAttributes[3] + _ + getAttributes[4];
   var new_row_id = document.getElementById(new_row_ +
  setCommonAttr).value;
   });
  
   Can anyone let me know what is wrong with the above code. Tried
 different
  options but with no success
  
  
  
  
 
 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342963
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Javascript question

2011-03-13 Thread Michael Grant

And one other thought. If your code posted accurately reflects the id's of
the items you can replace this:

 var getAttributes = row_id.split(_);
 var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ +
getAttributes[3] + _ + getAttributes[4];
 var new_row_id = document.getElementById(new_row_ + setCommonAttr).value;

with this:

var new_row_id = $('#new_' + row_id).val();

In both cases id is going to evaluate to: new_row_1_4_2009_abc so all you
need to do is prepend new_.


On Sun, Mar 13, 2011 at 1:48 PM, Michael Grant mgr...@modus.bz wrote:

 $(.rowclick) is completely acceptable. It will just add the function to
 all elements with that class name, which I assume is that the OP is looking
 for.

 OP: In the code you pasted what part isn't working exactly? All you are
 doing is setting some variables. I don't see in the code where any actually
 does anything other than populate variables which are all var'd to the
 function, they aren't global. Also, can you confirm that there is an element
 with the id of  new_row_1_4_2009_abc and a parameter called value?

 I guess it might help if we knew what exactly you were trying to accomplish
 in order to determine if it's working or not.

 On a side note, since you are using jQuery I'd recommend the jQuery
 $(#idname).val() instead of document.getElementById(idname).value.


 On Sun, Mar 13, 2011 at 12:17 PM, Russ Michaels r...@michaels.me.ukwrote:


 it looks like you are using the classname instead of the object ID.
 normally the $() function is fer getting a reference to a obejct by its
 ID.

 $(.rowclick)
 shouldn't this be
 $(row_1_4_2009_abc)




 On Sun, Mar 13, 2011 at 3:29 PM, Jake Churchill reyna...@gmail.com
 wrote:

 
  Look into jQuery's .each() method.  It helps in loopin over things like
  that
 
  -Jake
 
  Sent from my Droid
  On Mar 13, 2011 9:51 AM, fun and learning funandlrnn...@gmail.com
  wrote:
  
   Hi All - I am trying to get the following working. It seemed to work
  initially, but somehow it stopped working
  
   I have a row like below
  
   tr id=row_1_4_2009_abc class=rowclick
   td/td
   /tr
  
   I am using jquery to get the id on click of a row:
  
   $(.rowclick).click(function() {
   var row_id = $(this).attr(id);
   var getAttributes = row_id.split(_);
   var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ +
  getAttributes[3] + _ + getAttributes[4];
   var new_row_id = document.getElementById(new_row_ +
  setCommonAttr).value;
   });
  
   Can anyone let me know what is wrong with the above code. Tried
 different
  options but with no success
  
  
  
  
 
 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342964
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Javascript question

2011-03-13 Thread andy matthews

You didn't say what it is you're trying to accomplish, nor did you post
example code, so we can't really say what's not working. One thing you could
try is simplifying your code. Try replacing 3 lines with one:

// old lines
var getAttributes = row_id.split(_);
var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ +
getAttributes[3] + _ + getAttributes[4];
var new_row_id = document.getElementById(new_row_ +
setCommonAttr).value;});

// new line
new_row_id = $('#' + row_id.replace(/^row/,'new_row') );


-Original Message-
From: fun and learning [mailto:funandlrnn...@gmail.com] 
Sent: Sunday, March 13, 2011 9:43 AM
To: cf-talk
Subject: Javascript question


Hi All - I am trying to get the following working. It seemed to work
initially, but somehow it stopped working

I have a row like below

tr id=row_1_4_2009_abc class=rowclick
   td/td
/tr

I am using jquery to get the id on click of a row:

$(.rowclick).click(function() {
  var row_id = $(this).attr(id);
  var getAttributes = row_id.split(_);
  var setCommonAttr = getAttributes[1] + _ + getAttributes[2] + _ +
getAttributes[3] + _ + getAttributes[4];
  var new_row_id = document.getElementById(new_row_ +
setCommonAttr).value;
});

Can anyone let me know what is wrong with the above code. Tried different
options but with no success





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342965
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


custom tag and javascript question

2010-12-31 Thread Eric Roberts

I have been running into an issue with not being able to read across forms
on a site I am working on.  The site is set up so that instead of using
cfinclude, they address pages as custom tags (ie header.cfm is called as
cf_header url_val=xx.  The basic setup is there is an index.cfm that
acts like a driver page that calls the tags and the called pages may also
call tags as well.  We have a dropdown to select with all of the
properties or an individual property (Hotel properties).  We are adding the
ability for the hotels, if they take this into account, count the number of
infants.  This form field (itself a dropdown) is in a different form that is
physically located in a different file (which is the parent page that is
calling the file that the above dropdown live on).  In the rendered html and
javascript, the property section comes before the form that has the number
of infants.  What I am trying to accomplish is that when I change the hotel
property, I want it to check against a session var that determines whether
or not that property does an infant count and check a hidden form field to
see if the value of infants is greater than 0.  The problem I am having is
that the hidden field that I have in the form isn't showing up.  Does this
have something to do with the fact that pages are being used as custom tags?
I have never seen a site structured like this.it's pretty unique and not a
bad idea, but I am wondering what effects on how variables are available to
other tags/pages this structure has.

 

Here's the basic structure:

 

Index.cfm calls call_index.cfm as cf_call_index.cfm..call_index.cfm calls
call_index2.cfm as cf_call_index2.  Form 1 with the property dropdown
physically resides on call_index2.cfm and form 2 that has the infant count
dropdown physically resides on call_index.cfm.

 

 

Anyone have an experience dealing with this kind of structure?

 

Eric



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340337
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: custom tag and javascript question

2010-12-31 Thread Michael Grant

How your cf is set up does little to effect how the javascript will
communicate with other forms. JS will traverse your page in the usual way.
The fact that one form is in a different file than another form doesn't
matter to JS since by the time it gets to the client browser it's all one
page as it were.

How are you trying to get JS to target the forms now? What code is failing?


On Fri, Dec 31, 2010 at 1:06 PM, Eric Roberts 
ow...@threeravensconsulting.com wrote:


 I have been running into an issue with not being able to read across forms
 on a site I am working on.  The site is set up so that instead of using
 cfinclude, they address pages as custom tags (ie header.cfm is called as
 cf_header url_val=xx.  The basic setup is there is an index.cfm that
 acts like a driver page that calls the tags and the called pages may also
 call tags as well.  We have a dropdown to select with all of the
 properties or an individual property (Hotel properties).  We are adding the
 ability for the hotels, if they take this into account, count the number of
 infants.  This form field (itself a dropdown) is in a different form that
 is
 physically located in a different file (which is the parent page that is
 calling the file that the above dropdown live on).  In the rendered html
 and
 javascript, the property section comes before the form that has the number
 of infants.  What I am trying to accomplish is that when I change the hotel
 property, I want it to check against a session var that determines whether
 or not that property does an infant count and check a hidden form field to
 see if the value of infants is greater than 0.  The problem I am having is
 that the hidden field that I have in the form isn't showing up.  Does this
 have something to do with the fact that pages are being used as custom
 tags?
 I have never seen a site structured like this.it's pretty unique and not a
 bad idea, but I am wondering what effects on how variables are available to
 other tags/pages this structure has.



 Here's the basic structure:



 Index.cfm calls call_index.cfm as cf_call_index.cfm..call_index.cfm calls
 call_index2.cfm as cf_call_index2.  Form 1 with the property dropdown
 physically resides on call_index2.cfm and form 2 that has the infant count
 dropdown physically resides on call_index.cfm.





 Anyone have an experience dealing with this kind of structure?



 Eric



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340338
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: custom tag and javascript question

2010-12-31 Thread Russ Michaels

CF simply outputs any content in the file, it does not automatically make
any decisions about what to display unless you have defined this with
if/else block or switch/case statements or are dynamically generating the
content.
The other thing that could stop content being displayed is a cfsetting
enablecfoutputonly=yes or a cfsilent

Also as you are using custom tags you can block the content with
thistag.generatedcontent

so i would check your code for all these possibilities


Russ
On Fri, Dec 31, 2010 at 6:49 PM, Michael Grant mgr...@modus.bz wrote:


 How your cf is set up does little to effect how the javascript will
 communicate with other forms. JS will traverse your page in the usual way.
 The fact that one form is in a different file than another form doesn't
 matter to JS since by the time it gets to the client browser it's all one
 page as it were.

 How are you trying to get JS to target the forms now? What code is failing?


 On Fri, Dec 31, 2010 at 1:06 PM, Eric Roberts 
 ow...@threeravensconsulting.com wrote:

 
  I have been running into an issue with not being able to read across
 forms
  on a site I am working on.  The site is set up so that instead of using
  cfinclude, they address pages as custom tags (ie header.cfm is called as
  cf_header url_val=xx.  The basic setup is there is an index.cfm that
  acts like a driver page that calls the tags and the called pages may
 also
  call tags as well.  We have a dropdown to select with all of the
  properties or an individual property (Hotel properties).  We are adding
 the
  ability for the hotels, if they take this into account, count the number
 of
  infants.  This form field (itself a dropdown) is in a different form that
  is
  physically located in a different file (which is the parent page that is
  calling the file that the above dropdown live on).  In the rendered html
  and
  javascript, the property section comes before the form that has the
 number
  of infants.  What I am trying to accomplish is that when I change the
 hotel
  property, I want it to check against a session var that determines
 whether
  or not that property does an infant count and check a hidden form field
 to
  see if the value of infants is greater than 0.  The problem I am having
 is
  that the hidden field that I have in the form isn't showing up.  Does
 this
  have something to do with the fact that pages are being used as custom
  tags?
  I have never seen a site structured like this.it's pretty unique and not
 a
  bad idea, but I am wondering what effects on how variables are available
 to
  other tags/pages this structure has.
 
 
 
  Here's the basic structure:
 
 
 
  Index.cfm calls call_index.cfm as cf_call_index.cfm..call_index.cfm
 calls
  call_index2.cfm as cf_call_index2.  Form 1 with the property dropdown
  physically resides on call_index2.cfm and form 2 that has the infant
 count
  dropdown physically resides on call_index.cfm.
 
 
 
 
 
  Anyone have an experience dealing with this kind of structure?
 
 
 
  Eric
 
 
 
 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340339
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: custom tag and javascript question

2010-12-31 Thread Eric Roberts

In the same on change event that causes the page to go from all properties
to an individual property I have it assign the value of a hidden form field
to the value of the infants dropdown...yet when the page loads, there are no
form fields...

Eric
-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz] 
Sent: Friday, December 31, 2010 12:49 
To: cf-talk
Subject: Re: custom tag and javascript question


How your cf is set up does little to effect how the javascript will
communicate with other forms. JS will traverse your page in the usual way.
The fact that one form is in a different file than another form doesn't
matter to JS since by the time it gets to the client browser it's all one
page as it were.

How are you trying to get JS to target the forms now? What code is failing?


On Fri, Dec 31, 2010 at 1:06 PM, Eric Roberts 
ow...@threeravensconsulting.com wrote:


 I have been running into an issue with not being able to read across 
 forms on a site I am working on.  The site is set up so that instead 
 of using cfinclude, they address pages as custom tags (ie header.cfm 
 is called as cf_header url_val=xx.  The basic setup is there is an 
 index.cfm that acts like a driver page that calls the tags and the 
 called pages may also call tags as well.  We have a dropdown to 
 select with all of the properties or an individual property (Hotel 
 properties).  We are adding the ability for the hotels, if they take 
 this into account, count the number of infants.  This form field 
 (itself a dropdown) is in a different form that is physically located 
 in a different file (which is the parent page that is calling the file 
 that the above dropdown live on).  In the rendered html and 
 javascript, the property section comes before the form that has the 
 number of infants.  What I am trying to accomplish is that when I 
 change the hotel property, I want it to check against a session var 
 that determines whether or not that property does an infant count and 
 check a hidden form field to see if the value of infants is greater 
 than 0.  The problem I am having is that the hidden field that I have 
 in the form isn't showing up.  Does this have something to do with the 
 fact that pages are being used as custom tags?
 I have never seen a site structured like this.it's pretty unique and 
 not a bad idea, but I am wondering what effects on how variables are 
 available to other tags/pages this structure has.



 Here's the basic structure:



 Index.cfm calls call_index.cfm as cf_call_index.cfm..call_index.cfm 
 calls call_index2.cfm as cf_call_index2.  Form 1 with the property 
 dropdown physically resides on call_index2.cfm and form 2 that has the 
 infant count dropdown physically resides on call_index.cfm.





 Anyone have an experience dealing with this kind of structure?



 Eric



 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340340
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: custom tag and javascript question

2010-12-31 Thread Michael Grant

Maybe I'm not following along here. How can the JS assign a value to a
hidden form field if CF isn't rendering the hidden form field onto the page?
Is this hidden form field wrapped in cfoutput?


On Fri, Dec 31, 2010 at 2:46 PM, Eric Roberts 
ow...@threeravensconsulting.com wrote:


 In the same on change event that causes the page to go from all properties
 to an individual property I have it assign the value of a hidden form field
 to the value of the infants dropdown...yet when the page loads, there are
 no
 form fields...

 Eric
 -Original Message-
 From: Michael Grant [mailto:mgr...@modus.bz]
 Sent: Friday, December 31, 2010 12:49
 To: cf-talk
 Subject: Re: custom tag and javascript question


 How your cf is set up does little to effect how the javascript will
 communicate with other forms. JS will traverse your page in the usual way.
 The fact that one form is in a different file than another form doesn't
 matter to JS since by the time it gets to the client browser it's all one
 page as it were.

 How are you trying to get JS to target the forms now? What code is failing?


 On Fri, Dec 31, 2010 at 1:06 PM, Eric Roberts 
 ow...@threeravensconsulting.com wrote:

 
  I have been running into an issue with not being able to read across
  forms on a site I am working on.  The site is set up so that instead
  of using cfinclude, they address pages as custom tags (ie header.cfm
  is called as cf_header url_val=xx.  The basic setup is there is an
  index.cfm that acts like a driver page that calls the tags and the
  called pages may also call tags as well.  We have a dropdown to
  select with all of the properties or an individual property (Hotel
  properties).  We are adding the ability for the hotels, if they take
  this into account, count the number of infants.  This form field
  (itself a dropdown) is in a different form that is physically located
  in a different file (which is the parent page that is calling the file
  that the above dropdown live on).  In the rendered html and
  javascript, the property section comes before the form that has the
  number of infants.  What I am trying to accomplish is that when I
  change the hotel property, I want it to check against a session var
  that determines whether or not that property does an infant count and
  check a hidden form field to see if the value of infants is greater
  than 0.  The problem I am having is that the hidden field that I have
  in the form isn't showing up.  Does this have something to do with the
  fact that pages are being used as custom tags?
  I have never seen a site structured like this.it's pretty unique and
  not a bad idea, but I am wondering what effects on how variables are
  available to other tags/pages this structure has.
 
 
 
  Here's the basic structure:
 
 
 
  Index.cfm calls call_index.cfm as cf_call_index.cfm..call_index.cfm
  calls call_index2.cfm as cf_call_index2.  Form 1 with the property
  dropdown physically resides on call_index2.cfm and form 2 that has the
  infant count dropdown physically resides on call_index.cfm.
 
 
 
 
 
  Anyone have an experience dealing with this kind of structure?
 
 
 
  Eric
 
 
 
 



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340341
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: custom tag and javascript question

2010-12-31 Thread Eric Roberts

I think I see where the problem lies...instead of doing a standard
submit...it does a top.location.href to change from all properties to a
single one.  They do a lot of very odd stuff in this application.  I
certainly wouldn't have chosen to do that.

Eric
-Original Message-
From: Michael Grant [mailto:mgr...@modus.bz] 
Sent: Friday, December 31, 2010 14:20 
To: cf-talk
Subject: Re: custom tag and javascript question


Maybe I'm not following along here. How can the JS assign a value to a
hidden form field if CF isn't rendering the hidden form field onto the page?
Is this hidden form field wrapped in cfoutput?


On Fri, Dec 31, 2010 at 2:46 PM, Eric Roberts 
ow...@threeravensconsulting.com wrote:


 In the same on change event that causes the page to go from all 
 properties to an individual property I have it assign the value of a 
 hidden form field to the value of the infants dropdown...yet when the 
 page loads, there are no form fields...

 Eric
 -Original Message-
 From: Michael Grant [mailto:mgr...@modus.bz]
 Sent: Friday, December 31, 2010 12:49
 To: cf-talk
 Subject: Re: custom tag and javascript question


 How your cf is set up does little to effect how the javascript will 
 communicate with other forms. JS will traverse your page in the usual way.
 The fact that one form is in a different file than another form 
 doesn't matter to JS since by the time it gets to the client browser 
 it's all one page as it were.

 How are you trying to get JS to target the forms now? What code is
failing?


 On Fri, Dec 31, 2010 at 1:06 PM, Eric Roberts  
 ow...@threeravensconsulting.com wrote:

 
  I have been running into an issue with not being able to read across 
  forms on a site I am working on.  The site is set up so that instead 
  of using cfinclude, they address pages as custom tags (ie header.cfm 
  is called as cf_header url_val=xx.  The basic setup is there is 
  an index.cfm that acts like a driver page that calls the tags and 
  the called pages may also call tags as well.  We have a dropdown 
  to select with all of the properties or an individual property 
  (Hotel properties).  We are adding the ability for the hotels, if 
  they take this into account, count the number of infants.  This form 
  field (itself a dropdown) is in a different form that is physically 
  located in a different file (which is the parent page that is 
  calling the file that the above dropdown live on).  In the rendered 
  html and javascript, the property section comes before the form that 
  has the number of infants.  What I am trying to accomplish is that 
  when I change the hotel property, I want it to check against a 
  session var that determines whether or not that property does an 
  infant count and check a hidden form field to see if the value of 
  infants is greater than 0.  The problem I am having is that the 
  hidden field that I have in the form isn't showing up.  Does this 
  have something to do with the fact that pages are being used as custom
tags?
  I have never seen a site structured like this.it's pretty unique and 
  not a bad idea, but I am wondering what effects on how variables are 
  available to other tags/pages this structure has.
 
 
 
  Here's the basic structure:
 
 
 
  Index.cfm calls call_index.cfm as 
  cf_call_index.cfm..call_index.cfm
  calls call_index2.cfm as cf_call_index2.  Form 1 with the property 
  dropdown physically resides on call_index2.cfm and form 2 that has 
  the infant count dropdown physically resides on call_index.cfm.
 
 
 
 
 
  Anyone have an experience dealing with this kind of structure?
 
 
 
  Eric
 
 
 
 



 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340342
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Javascript question

2009-03-18 Thread Jenny Gavin-Wear

I have in the header:

script type=text/javascript
function submitForm()
{
document.getElementById(registerForm).submit()
}
/script

and this as the trigger:

input name=roomID type=radio id=radio value=0 cfif session.roomID
is 0checked /cfif onClick=submitForm()

I am getting the error:
document.registerForm.submit is not a function

Could someone tell me what I am doing wrong, please?

tia, Jenny



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320639
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Javascript question

2009-03-18 Thread Ian Skinner

Jenny Gavin-Wear wrote:
 Could someone tell me what I am doing wrong, please?

Does your form control of an id of 'registerForm' with that exact 
capitalization?

Is it the only thing on the page with that id?





~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320640
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Javascript question

2009-03-18 Thread Massimo Foti

 script type=text/javascript
 function submitForm()
 {
 document.getElementById(registerForm).submit()
 }
 /script

 and this as the trigger:

 input name=roomID type=radio id=radio value=0 cfif 
 session.roomID
 is 0checked /cfif onClick=submitForm()

 I am getting the error:
 document.registerForm.submit is not a function

 Could someone tell me what I am doing wrong, please?

Let me guess... Your form contains an element named submit? IE doesn't 
like that (should be fine in FF).


Massimo Foti, web-programmer for hire
Tools for ColdFusion, JavaScript and Dreamweaver:
http://www.massimocorner.com



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320641
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Javascript question

2009-03-18 Thread Ryan Stille

Do you have ID=registerForm in your opening form tag?  Don't forget it 
is case sensitive, too.

-Ryan

Jenny Gavin-Wear wrote:
 I have in the header:

 script type=text/javascript
 function submitForm()
 {
 document.getElementById(registerForm).submit()
 }
 /script

 and this as the trigger:

 input name=roomID type=radio id=radio value=0 cfif session.roomID
 is 0checked /cfif onClick=submitForm()

 I am getting the error:
 document.registerForm.submit is not a function

 Could someone tell me what I am doing wrong, please?

 tia, Jenny



 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320642
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Javascript question

2009-03-18 Thread Claude Schneegans

 document.registerForm.submit is not a function

Apparently, getElementById() has returned an object which is not a form, 
thus which has no submit function..
Make sure no other object has an id=registerForm.

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320644
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


IUM Re: Javascript question

2009-03-18 Thread Jenny Gavin-Wear

Thanks all for the rapid replies.

I'm sure it's something stupid I'm doing, arrghhh

I've tried this as a test and it works fine:

cfquery name=rooms datasource=#application.cfdatasource#
SELECT *
FROM tbl_confRooms
where confID = #session.confID#
/cfquery

HTML
HEAD
/HEAD
BODY BGCOLOR=#FF
form method=post name=MyForm id=MyForm action=register-new.cfm 
!---
FORM METHOD=POST name=MyForm action=process.asp
---
1INPUT TYPE=radio NAME=rdo onClick=document.MyForm.submit()BR
2INPUT TYPE=radio NAME=rdo onClick=document.MyForm.submit()BR
3INPUT TYPE=radio NAME=rdo onClick=document.MyForm.submit()BR
4INPUT TYPE=radio NAME=rdo onClick=document.MyForm.submit()BR
cfoutput query=rooms
4.5input type=radio name=roomID value=#rooms.roomID#
onClick=document.MyForm.submit()cfif session.temproomID is
session.roomID checked /cfif
/cfoutput
5input name=roomID type=radio value=0
onClick=document.MyForm.submit()cfif session.roomID is 0 checked
/cfif
/FORM
/BODY
/HTML

But when it's on the page I need it on I get the error:

cfif not isdefined(session.isMember)
cfset session.ismember = 0
/cfif
cfif isdefined(url.ismember) and val(url.isMember) gt 0
cfset session.ismember = url.ismember
/cfif

cfif isdefined(url.confID)
cfset session.confID = url.confID
/cfif
cfif not isdefined(session.confid)
cflocation url=../ukasfp/conference.cfm
/cfif
cfif not isdefined(session.roomID)
cfset session.roomID = 0
/cfif

!--- Conference ---
cfquery name=conf datasource=#application.cfdatasource#
SELECT *
FROM tbl_conf
where confID = #session.confID#
/cfquery

cfset session.confprice = conf.confPrice

!--- MEMBER ---
cfif isdefined(session.userID) and val(session.userID) gt 0
cfquery name=member datasource=#application.cfdatasource#
SELECT *
FROM tbl_members
where memberID = #session.userID#
/cfquery
cfset session.confprice = conf.confMemberPrice
/cfif

cfif isdefined(form.name)
cfset session.name = form.name
/cfif
cfif isdefined(form.email)
cfset session.email = form.email
/cfif
cfif isdefined(form.phone)
cfset session.phone = form.phone
/cfif
cfif isdefined(form.add1)
cfset session.add1 = form.add1
/cfif
cfif isdefined(form.add2)
cfset session.add2 = form.add2
/cfif
cfif isdefined(form.city)
cfset session.city = form.city
/cfif
cfif isdefined(form.county)
cfset session.county = form.county
/cfif
cfif isdefined(form.postcode)
cfset session.postcode = form.postcode
/cfif
cfif isdefined(form.roomID)
cfset session.roomID = form.roomID
/cfif

cfset session.continue = 1
cfif not isdefined(session.name) or not len(session.name)
cfset session.continue = 0
/cfif
cfif not isdefined(session.email) or not len(session.email)
cfset session.continue = 0
/cfif
cfif not isdefined(session.phone) or not len(session.phone)
cfset session.continue = 0
/cfif
cfif not isdefined(session.add1) or not len(session.add1)
cfset session.continue = 0
/cfif
cfif not isdefined(session.add2) or not len(session.add2)
cfset session.continue = 0
/cfif
cfif not isdefined(session.city) or not len(session.city)
cfset session.continue = 0
/cfif
cfif not isdefined(session.county) or not len(session.county)
cfset session.continue = 0
/cfif
cfif not isdefined(session.postcode) or not len(session.postcode)
cfset session.continue = 0
/cfif


!--- ACCOMMODATION ---
!--- all rooms ---
cfquery name=rooms datasource=#application.cfdatasource#
SELECT *
FROM tbl_confRooms
where confID = #session.confID#
/cfquery
!--- booked room ---
cfif isdefined(session.roomID) and val(session.roomID) gt 0
cfquery name=BookedRoom datasource=#application.cfdatasource#
SELECT *
FROM tbl_confRooms
where roomid = #session.roomID#
/cfquery
cfset session.confprice = session.confprice + bookedRoom.roomprice
/cfif

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
html!-- InstanceBegin template=/Templates/2005-01-09.dwt.cfm
codeOutsideHTMLIsLocked=false --
head
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
!-- InstanceBeginEditable name=doctitle --
titleUntitled Document/title

!-- InstanceEndEditable --
link href=../styles.css rel=stylesheet media=screen type=text/css
LINK REL=stylesheet MEDIA=aural HREF=../ukaural.css TYPE=text/css
LINK REL=stylesheet MEDIA=print HREF=../ukprintfinal.css
TYPE=text/css
!-- InstanceBeginEditable name=head --!-- InstanceEndEditable --
/head

body
table width=800  border=0 align=center cellpadding=5
cellspacing=0 id=main
  tr
td colspan=2table width=100%  border=0 cellpadding=0
cellspacing=0 id=header
  tr
tdimg src=../pageart/ukasfp-logo.png alt=United Kingdom
Association for Solution Focused Practice width=800 height=132/td
  /tr
/table/td
  /tr
  tr
td colspan=2table width=100% border=0 cellpadding=5
cellspacing=0 id=navtop
  tr
td
  cfinclude template=../nav/menu-top.cfm
/td
td
cfoutput
ul
lia href=/directory/joining.cfmJoin UKASFP/a/li
cfif not isdefined(session.mm_username) or 

IUM IUM Re: Javascript question

2009-03-18 Thread Jenny Gavin-Wear

ha! Got it!

it was the submit buttons on the page being named submit ...

Thanks all, pointed me in the right direction !!

-Original Message-
From: Jenny Gavin-Wear [mailto:jenn...@fasttrackonline.co.uk]
Sent: 18 March 2009 14:24
To: cf-talk
Subject: SPAM-MEDIUM IUM Re: Javascript question



Thanks all for the rapid replies.

I'm sure it's something stupid I'm doing, arrghhh

I've tried this as a test and it works fine:

cfquery name=rooms datasource=#application.cfdatasource#
SELECT *
FROM tbl_confRooms
where confID = #session.confID#
/cfquery

HTML
HEAD
/HEAD
BODY BGCOLOR=#FF
form method=post name=MyForm id=MyForm action=register-new.cfm 
!---
FORM METHOD=POST name=MyForm action=process.asp
---
1INPUT TYPE=radio NAME=rdo onClick=document.MyForm.submit()BR
2INPUT TYPE=radio NAME=rdo onClick=document.MyForm.submit()BR
3INPUT TYPE=radio NAME=rdo onClick=document.MyForm.submit()BR
4INPUT TYPE=radio NAME=rdo onClick=document.MyForm.submit()BR
cfoutput query=rooms
4.5input type=radio name=roomID value=#rooms.roomID#
onClick=document.MyForm.submit()cfif session.temproomID is
session.roomID checked /cfif
/cfoutput
5input name=roomID type=radio value=0
onClick=document.MyForm.submit()cfif session.roomID is 0 checked
/cfif
/FORM
/BODY
/HTML

But when it's on the page I need it on I get the error:

cfif not isdefined(session.isMember)
cfset session.ismember = 0
/cfif
cfif isdefined(url.ismember) and val(url.isMember) gt 0
cfset session.ismember = url.ismember
/cfif

cfif isdefined(url.confID)
cfset session.confID = url.confID
/cfif
cfif not isdefined(session.confid)
cflocation url=../ukasfp/conference.cfm
/cfif
cfif not isdefined(session.roomID)
cfset session.roomID = 0
/cfif

!--- Conference ---
cfquery name=conf datasource=#application.cfdatasource#
SELECT *
FROM tbl_conf
where confID = #session.confID#
/cfquery

cfset session.confprice = conf.confPrice

!--- MEMBER ---
cfif isdefined(session.userID) and val(session.userID) gt 0
cfquery name=member datasource=#application.cfdatasource#
SELECT *
FROM tbl_members
where memberID = #session.userID#
/cfquery
cfset session.confprice = conf.confMemberPrice
/cfif

cfif isdefined(form.name)
cfset session.name = form.name
/cfif
cfif isdefined(form.email)
cfset session.email = form.email
/cfif
cfif isdefined(form.phone)
cfset session.phone = form.phone
/cfif
cfif isdefined(form.add1)
cfset session.add1 = form.add1
/cfif
cfif isdefined(form.add2)
cfset session.add2 = form.add2
/cfif
cfif isdefined(form.city)
cfset session.city = form.city
/cfif
cfif isdefined(form.county)
cfset session.county = form.county
/cfif
cfif isdefined(form.postcode)
cfset session.postcode = form.postcode
/cfif
cfif isdefined(form.roomID)
cfset session.roomID = form.roomID
/cfif

cfset session.continue = 1
cfif not isdefined(session.name) or not len(session.name)
cfset session.continue = 0
/cfif
cfif not isdefined(session.email) or not len(session.email)
cfset session.continue = 0
/cfif
cfif not isdefined(session.phone) or not len(session.phone)
cfset session.continue = 0
/cfif
cfif not isdefined(session.add1) or not len(session.add1)
cfset session.continue = 0
/cfif
cfif not isdefined(session.add2) or not len(session.add2)
cfset session.continue = 0
/cfif
cfif not isdefined(session.city) or not len(session.city)
cfset session.continue = 0
/cfif
cfif not isdefined(session.county) or not len(session.county)
cfset session.continue = 0
/cfif
cfif not isdefined(session.postcode) or not len(session.postcode)
cfset session.continue = 0
/cfif


!--- ACCOMMODATION ---
!--- all rooms ---
cfquery name=rooms datasource=#application.cfdatasource#
SELECT *
FROM tbl_confRooms
where confID = #session.confID#
/cfquery
!--- booked room ---
cfif isdefined(session.roomID) and val(session.roomID) gt 0
cfquery name=BookedRoom datasource=#application.cfdatasource#
SELECT *
FROM tbl_confRooms
where roomid = #session.roomID#
/cfquery
cfset session.confprice = session.confprice + bookedRoom.roomprice
/cfif

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
html!-- InstanceBegin template=/Templates/2005-01-09.dwt.cfm
codeOutsideHTMLIsLocked=false --
head
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
!-- InstanceBeginEditable name=doctitle --
titleUntitled Document/title

!-- InstanceEndEditable --
link href=../styles.css rel=stylesheet media=screen type=text/css
LINK REL=stylesheet MEDIA=aural HREF=../ukaural.css TYPE=text/css
LINK REL=stylesheet MEDIA=print HREF=../ukprintfinal.css
TYPE=text/css
!-- InstanceBeginEditable name=head --!-- InstanceEndEditable --
/head

body
table width=800  border=0 align=center cellpadding=5
cellspacing=0 id=main
  tr
td colspan=2table width=100%  border=0 cellpadding=0
cellspacing=0 id=header
  tr
tdimg src=../pageart/ukasfp-logo.png alt=United Kingdom
Association for Solution Focused Practice width=800 height=132/td
  /tr
/table/td
  /tr
  tr
td colspan=2table width=100% border=0

Javascript question

2009-02-13 Thread Scott Stewart

I've got a chunk of javascript that's supposed to do something really 
simple, toggle radio buttons on and off (disable/enable)
based on another radio button

However, there's a bug in IE, 
(http://webbugtrack.blogspot.com/2007/08/bug-152-getelementbyid-returns.html) 
that forces me (I think)
to add some additional code, which under normal circumstances wouldn't 
be a big deal.

The layout that I'm dealing with has multiple nested tables and alot of 
other elements, and re-working the layout is out of the question so...
Is there a way, given the code below. to just deal with the ID's inside 
the form?
Here's the code:

function toggleOnPaidLeave(){
   * // this code corrects javascript bugs in IE and Opera*
//use browser sniffing to determine if IE or Opera (ugly, but 
required)
var toggle;
var isOpera,
isIE = false;
if(typeof(window.opera) != 'undefined'){
isOpera = true;
}
if(!isOpera  navigator.userAgent.indexOf('Internet Explorer')){
isIE = true;}
//fix both IE and Opera (adjust when they implement this method 
properly)
if(isOpera || isIE){ 
document.nativeGetElementById = document.getElementById; 
//redefine it! 
document.getElementById = function(id){   
var elem = document.nativeGetElementById(id);   
if(elem){ 
//verify it is a valid match! 
if(elem.attributes['id']  
elem.attributes['id'].value == id){   
//valid match!   
return elem; 
} else {   
//not a valid match!   
//the non-standard, document.all array has keys 
for all name'd, and id'd elements   
//start at one, because we know the first match, 
is wrong!   
for(var 
i=1;idocument.all[id].length;i++){ 
if(document.all[id][i].attributes['id']  
document.all[id][i].attributes['id'].value == id){  
 return document.all[id][i];
  }   
}
 }   
}   
return null; 
};
}
   
   
 *//this is what I actually want to do*
if(toggle = 1){
document.getElementById(pre_absent).disabled=true;
document.getElementById(alternative_week_id).disabled=true;
document.getElementById(pre_pretransplant).disabled=true;
document.getElementById(pre_pediatric_clinic).disabled=true;
}else{
document.getElementById(pre_absent).disabled=false;
document.getElementById(alternative_week_id).disabled=false;
document.getElementById(pre_pretransplant).disabled=false;
document.getElementById(pre_pediatric_clinic).disabled=false;
}
   
}
   

-- 
Scott Stewart
ColdFusion Developer

Office of Research Information Systems
Research amp; Economic Development
University of North Carolina at Chapel Hill

Phone:(919)843-2408
Fax: (919)962-3600
Email: saste...@email.unc.edu



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319280
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Javascript question

2009-02-13 Thread Dawson, Michael

This isn't the answer you are asking for, but I would suggest that you
use jQuery for this task.

jQuery's selectors would make it easier to find the objects you want to
modify, then you can easily set the disabled flag, as needed.

Thanks,
Mike

-Original Message-
From: Scott Stewart [mailto:saste...@email.unc.edu] 
Sent: Friday, February 13, 2009 10:11 AM
To: cf-talk
Subject: Javascript question


I've got a chunk of javascript that's supposed to do something really
simple, toggle radio buttons on and off (disable/enable) based on
another radio button

However, there's a bug in IE,
(http://webbugtrack.blogspot.com/2007/08/bug-152-getelementbyid-returns.
html)
that forces me (I think)
to add some additional code, which under normal circumstances wouldn't
be a big deal.

The layout that I'm dealing with has multiple nested tables and alot of
other elements, and re-working the layout is out of the question so...
Is there a way, given the code below. to just deal with the ID's inside
the form?
Here's the code:

function toggleOnPaidLeave(){
   * // this code corrects javascript bugs in IE and Opera*
//use browser sniffing to determine if IE or Opera (ugly, but
required)
var toggle;
var isOpera,
isIE = false;
if(typeof(window.opera) != 'undefined'){
isOpera = true;
}
if(!isOpera  navigator.userAgent.indexOf('Internet
Explorer')){
isIE = true;}
//fix both IE and Opera (adjust when they implement this method
properly)
if(isOpera || isIE){ 
document.nativeGetElementById = document.getElementById; 
//redefine it! 
document.getElementById = function(id){   
var elem = document.nativeGetElementById(id);   
if(elem){ 
//verify it is a valid match! 
if(elem.attributes['id']  
elem.attributes['id'].value == id){   
//valid match!   
return elem; 
} else {   
//not a valid match!   
//the non-standard, document.all array has keys 
for all name'd, and id'd elements   
//start at one, because we know the first match,

is wrong!   
for(var 
i=1;idocument.all[id].length;i++){ 
if(document.all[id][i].attributes['id']  
document.all[id][i].attributes['id'].value == id){  
 return document.all[id][i];
  }   
}
 }   
}   
return null; 
};
}
   
   
 *//this is what I actually want to do*
if(toggle = 1){
document.getElementById(pre_absent).disabled=true;
 
document.getElementById(alternative_week_id).disabled=true;
document.getElementById(pre_pretransplant).disabled=true;
 
document.getElementById(pre_pediatric_clinic).disabled=true;
}else{
document.getElementById(pre_absent).disabled=false;
 
document.getElementById(alternative_week_id).disabled=false;
document.getElementById(pre_pretransplant).disabled=false;
 
document.getElementById(pre_pediatric_clinic).disabled=false;
}
   
}
   

--
Scott Stewart
ColdFusion Developer

Office of Research Information Systems
Research amp; Economic Development
University of North Carolina at Chapel Hill

Phone:(919)843-2408
Fax: (919)962-3600
Email: saste...@email.unc.edu





~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319281
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Javascript question

2009-02-13 Thread Scott Stewart

I wish I could,  I've had fits trying to get jquery to function properly 
with this layout in IE.
I'm not sure jquery likes nested tables.

Dawson, Michael wrote:
 This isn't the answer you are asking for, but I would suggest that you
 use jQuery for this task.

 jQuery's selectors would make it easier to find the objects you want to
 modify, then you can easily set the disabled flag, as needed.

 Thanks,
 Mike

 -Original Message-
 From: Scott Stewart [mailto:saste...@email.unc.edu] 
 Sent: Friday, February 13, 2009 10:11 AM
 To: cf-talk
 Subject: Javascript question


 I've got a chunk of javascript that's supposed to do something really
 simple, toggle radio buttons on and off (disable/enable) based on
 another radio button

 However, there's a bug in IE,
 (http://webbugtrack.blogspot.com/2007/08/bug-152-getelementbyid-returns.
 html)
 that forces me (I think)
 to add some additional code, which under normal circumstances wouldn't
 be a big deal.

 The layout that I'm dealing with has multiple nested tables and alot of
 other elements, and re-working the layout is out of the question so...
 Is there a way, given the code below. to just deal with the ID's inside
 the form?
 Here's the code:

 function toggleOnPaidLeave(){
* // this code corrects javascript bugs in IE and Opera*
 //use browser sniffing to determine if IE or Opera (ugly, but
 required)
 var toggle;
 var isOpera,
 isIE = false;
 if(typeof(window.opera) != 'undefined'){
 isOpera = true;
 }
 if(!isOpera  navigator.userAgent.indexOf('Internet
 Explorer')){
 isIE = true;}
 //fix both IE and Opera (adjust when they implement this method
 properly)
 if(isOpera || isIE){ 
 document.nativeGetElementById = document.getElementById; 
 //redefine it! 
 document.getElementById = function(id){   
 var elem = document.nativeGetElementById(id);   
 if(elem){ 
 //verify it is a valid match! 
 if(elem.attributes['id']  
 elem.attributes['id'].value == id){   
 //valid match!   
 return elem; 
 } else {   
 //not a valid match!   
 //the non-standard, document.all array has keys 
 for all name'd, and id'd elements   
 //start at one, because we know the first match,

 is wrong!   
 for(var 
 i=1;idocument.all[id].length;i++){ 
 if(document.all[id][i].attributes['id']  
 document.all[id][i].attributes['id'].value == id){  
  return document.all[id][i];
   }   
 }
  }   
 }   
 return null; 
 };
 }


  *//this is what I actually want to do*
 if(toggle = 1){
 document.getElementById(pre_absent).disabled=true;
  
 document.getElementById(alternative_week_id).disabled=true;
 document.getElementById(pre_pretransplant).disabled=true;
  
 document.getElementById(pre_pediatric_clinic).disabled=true;
 }else{
 document.getElementById(pre_absent).disabled=false;
  
 document.getElementById(alternative_week_id).disabled=false;
 document.getElementById(pre_pretransplant).disabled=false;
  
 document.getElementById(pre_pediatric_clinic).disabled=false;
 }

 }


 --
 Scott Stewart
 ColdFusion Developer

 Office of Research Information Systems
 Research amp; Economic Development
 University of North Carolina at Chapel Hill

 Phone:(919)843-2408
 Fax: (919)962-3600
 Email: saste...@email.unc.edu





 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319282
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Javascript question

2009-02-13 Thread Adrian Lynch

I know, I hate it sometimes too when you ask a question and someone says,
don't do it that way, do it this completely different way, but, jQuery!

script type=text/javascript src=/scripts/jquery-1.3.1.min.js/script
script type=text/javascript
$(function() {


$(.checkAll).change(function() {

if (this.checked) {
var checked = checked;
} else {
var checked = ;
}

$(input.checkGroup,
$(this).parent()).attr(checked, checked);

});

});
/script

cfoutput

h2Group 1/h2
div
All input type=checkbox class=checkAll /br /
cfloop from=1 to=10 index=i
#i# input type=checkbox class=checkGroup /br /
/cfloop
/div

h2Group 2/h2
div
All input type=checkbox class=checkAll /br /
cfloop from=1 to=10 index=i
#i# input type=checkbox class=checkGroup  /br /
/cfloop
/div

/cfoutput

Download jQuery, change the path to it and run this.

Adrian

 -Original Message-
 From: Scott Stewart [mailto:saste...@email.unc.edu]
 Sent: 13 February 2009 16:11
 To: cf-talk
 Subject: Javascript question
 
 
 I've got a chunk of javascript that's supposed to do something really
 simple, toggle radio buttons on and off (disable/enable)
 based on another radio button
 
 However, there's a bug in IE,
 (http://webbugtrack.blogspot.com/2007/08/bug-152-getelementbyid-
 returns.html)
 that forces me (I think)
 to add some additional code, which under normal circumstances wouldn't
 be a big deal.
 
 The layout that I'm dealing with has multiple nested tables and alot of
 other elements, and re-working the layout is out of the question so...
 Is there a way, given the code below. to just deal with the ID's inside
 the form?
 Here's the code:
 
 function toggleOnPaidLeave(){
* // this code corrects javascript bugs in IE and Opera*
 //use browser sniffing to determine if IE or Opera (ugly, but
 required)
 var toggle;
 var isOpera,
 isIE = false;
 if(typeof(window.opera) != 'undefined'){
 isOpera = true;
 }
 if(!isOpera  navigator.userAgent.indexOf('Internet
 Explorer')){
 isIE = true;}
 //fix both IE and Opera (adjust when they implement this method
 properly)
 if(isOpera || isIE){
 document.nativeGetElementById = document.getElementById;
 //redefine it!
 document.getElementById = function(id){
 var elem = document.nativeGetElementById(id);
 if(elem){
 //verify it is a valid match!
 if(elem.attributes['id'] 
 elem.attributes['id'].value == id){
 //valid match!
 return elem;
 } else {
 //not a valid match!
 //the non-standard, document.all array has keys
 for all name'd, and id'd elements
 //start at one, because we know the first
 match,
 is wrong!
 for(var
 i=1;idocument.all[id].length;i++){
 if(document.all[id][i].attributes['id'] 
 document.all[id][i].attributes['id'].value == id){
  return document.all[id][i];
   }
 }
  }
 }
 return null;
 };
 }
 
 
  *//this is what I actually want to do*
 if(toggle = 1){
 document.getElementById(pre_absent).disabled=true;
 
 document.getElementById(alternative_week_id).disabled=true;
 document.getElementById(pre_pretransplant).disabled=true;
 
 document.getElementById(pre_pediatric_clinic).disabled=true;
 }else{
 document.getElementById(pre_absent).disabled=false;
 
 document.getElementById(alternative_week_id).disabled=false;
 
 document.getElementById(pre_pretransplant).disabled=false;
 
 document.getElementById(pre_pediatric_clinic).disabled=false;
 }
 
 }
 
 
 --
 Scott Stewart
 ColdFusion Developer
 
 Office of Research Information Systems
 Research amp; Economic Development
 University of North Carolina at Chapel Hill
 
 Phone:(919)843-2408
 Fax: (919)962-3600
 Email: saste...@email.unc.edu


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319283
Subscription: http://www.houseoffusion.com/groups/cf-talk

RE: Javascript question

2009-02-13 Thread Adrian Lynch

Could you post the HTML source for us? Or point to it on t'internet.

Adrian

 -Original Message-
 From: Scott Stewart [mailto:saste...@email.unc.edu]
 Sent: 13 February 2009 16:28
 To: cf-talk
 Subject: Re: Javascript question
 
 
 I wish I could,  I've had fits trying to get jquery to function
 properly
 with this layout in IE.
 I'm not sure jquery likes nested tables.
 
 Dawson, Michael wrote:
  This isn't the answer you are asking for, but I would suggest that
 you
  use jQuery for this task.
 
  jQuery's selectors would make it easier to find the objects you want
 to
  modify, then you can easily set the disabled flag, as needed.
 
  Thanks,
  Mike
 
  -Original Message-
  From: Scott Stewart [mailto:saste...@email.unc.edu]
  Sent: Friday, February 13, 2009 10:11 AM
  To: cf-talk
  Subject: Javascript question
 
 
  I've got a chunk of javascript that's supposed to do something really
  simple, toggle radio buttons on and off (disable/enable) based on
  another radio button
 
  However, there's a bug in IE,
  (http://webbugtrack.blogspot.com/2007/08/bug-152-getelementbyid-
 returns.
  html)
  that forces me (I think)
  to add some additional code, which under normal circumstances
 wouldn't
  be a big deal.
 
  The layout that I'm dealing with has multiple nested tables and alot
 of
  other elements, and re-working the layout is out of the question
 so...
  Is there a way, given the code below. to just deal with the ID's
 inside
  the form?
  Here's the code:
 
  function toggleOnPaidLeave(){
 * // this code corrects javascript bugs in IE and Opera*
  //use browser sniffing to determine if IE or Opera (ugly, but
  required)
  var toggle;
  var isOpera,
  isIE = false;
  if(typeof(window.opera) != 'undefined'){
  isOpera = true;
  }
  if(!isOpera  navigator.userAgent.indexOf('Internet
  Explorer')){
  isIE = true;}
  //fix both IE and Opera (adjust when they implement this
 method
  properly)
  if(isOpera || isIE){
  document.nativeGetElementById = document.getElementById;
  //redefine it!
  document.getElementById = function(id){
  var elem = document.nativeGetElementById(id);
  if(elem){
  //verify it is a valid match!
  if(elem.attributes['id'] 
  elem.attributes['id'].value == id){
  //valid match!
  return elem;
  } else {
  //not a valid match!
  //the non-standard, document.all array has
 keys
  for all name'd, and id'd elements
  //start at one, because we know the first
 match,
 
  is wrong!
  for(var
  i=1;idocument.all[id].length;i++){
  if(document.all[id][i].attributes['id']
 
  document.all[id][i].attributes['id'].value == id){
   return document.all[id][i];
}
  }
   }
  }
  return null;
  };
  }
 
 
   *//this is what I actually want to do*
  if(toggle = 1){
  document.getElementById(pre_absent).disabled=true;
 
  document.getElementById(alternative_week_id).disabled=true;
 
 document.getElementById(pre_pretransplant).disabled=true;
 
  document.getElementById(pre_pediatric_clinic).disabled=true;
  }else{
  document.getElementById(pre_absent).disabled=false;
 
  document.getElementById(alternative_week_id).disabled=false;
 
 document.getElementById(pre_pretransplant).disabled=false;
 
  document.getElementById(pre_pediatric_clinic).disabled=false;
  }
 
  }
 
 
  --
  Scott Stewart
  ColdFusion Developer
 
  Office of Research Information Systems
  Research amp; Economic Development
  University of North Carolina at Chapel Hill
 
  Phone:(919)843-2408
  Fax: (919)962-3600
  Email: saste...@email.unc.edu
 
 
 
 
 
 
 
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319284
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Javascript question

2009-02-13 Thread Scott Stewart

jquery doesn't work with this layout, that's the first place I went.

Adrian Lynch wrote:
 I know, I hate it sometimes too when you ask a question and someone says,
 don't do it that way, do it this completely different way, but, jQuery!

 script type=text/javascript src=/scripts/jquery-1.3.1.min.js/script
 script type=text/javascript
   $(function() {

   
   $(.checkAll).change(function() {
   
   if (this.checked) {
   var checked = checked;
   } else {
   var checked = ;
   }
   
   $(input.checkGroup,
 $(this).parent()).attr(checked, checked);
   
   });

   });
 /script

 cfoutput

 h2Group 1/h2
 div
   All input type=checkbox class=checkAll /br /
   cfloop from=1 to=10 index=i
   #i# input type=checkbox class=checkGroup /br /
   /cfloop
 /div

 h2Group 2/h2
 div
   All input type=checkbox class=checkAll /br /
   cfloop from=1 to=10 index=i
   #i# input type=checkbox class=checkGroup  /br /
   /cfloop
 /div

 /cfoutput

 Download jQuery, change the path to it and run this.

 Adrian

   
 -Original Message-
 From: Scott Stewart [mailto:saste...@email.unc.edu]
 Sent: 13 February 2009 16:11
 To: cf-talk
 Subject: Javascript question


 I've got a chunk of javascript that's supposed to do something really
 simple, toggle radio buttons on and off (disable/enable)
 based on another radio button

 However, there's a bug in IE,
 (http://webbugtrack.blogspot.com/2007/08/bug-152-getelementbyid-
 returns.html)
 that forces me (I think)
 to add some additional code, which under normal circumstances wouldn't
 be a big deal.

 The layout that I'm dealing with has multiple nested tables and alot of
 other elements, and re-working the layout is out of the question so...
 Is there a way, given the code below. to just deal with the ID's inside
 the form?
 Here's the code:

 function toggleOnPaidLeave(){
* // this code corrects javascript bugs in IE and Opera*
 //use browser sniffing to determine if IE or Opera (ugly, but
 required)
 var toggle;
 var isOpera,
 isIE = false;
 if(typeof(window.opera) != 'undefined'){
 isOpera = true;
 }
 if(!isOpera  navigator.userAgent.indexOf('Internet
 Explorer')){
 isIE = true;}
 //fix both IE and Opera (adjust when they implement this method
 properly)
 if(isOpera || isIE){
 document.nativeGetElementById = document.getElementById;
 //redefine it!
 document.getElementById = function(id){
 var elem = document.nativeGetElementById(id);
 if(elem){
 //verify it is a valid match!
 if(elem.attributes['id'] 
 elem.attributes['id'].value == id){
 //valid match!
 return elem;
 } else {
 //not a valid match!
 //the non-standard, document.all array has keys
 for all name'd, and id'd elements
 //start at one, because we know the first
 match,
 is wrong!
 for(var
 i=1;idocument.all[id].length;i++){
 if(document.all[id][i].attributes['id'] 
 document.all[id][i].attributes['id'].value == id){
  return document.all[id][i];
   }
 }
  }
 }
 return null;
 };
 }


  *//this is what I actually want to do*
 if(toggle = 1){
 document.getElementById(pre_absent).disabled=true;

 document.getElementById(alternative_week_id).disabled=true;
 document.getElementById(pre_pretransplant).disabled=true;

 document.getElementById(pre_pediatric_clinic).disabled=true;
 }else{
 document.getElementById(pre_absent).disabled=false;

 document.getElementById(alternative_week_id).disabled=false;

 document.getElementById(pre_pretransplant).disabled=false;

 document.getElementById(pre_pediatric_clinic).disabled=false;
 }

 }


 --
 Scott Stewart
 ColdFusion Developer

 Office of Research Information Systems
 Research amp; Economic Development
 University of North Carolina at Chapel Hill

 Phone:(919)843-2408
 Fax: (919)962-3600
 Email: saste...@email.unc.edu
 


 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm

Re: Javascript question

2009-02-13 Thread Claude Schneegans

Hi,

IMHO, the simplest on most efficient way to bypass the problem would be 
to make sure
no element has a name which could be identical to the ID of another one.
For instance, always use something like ID=id_ NAME=name_

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319287
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Javascript question

2009-02-13 Thread Brian Swartzfager

jquery doesn't work with this layout, that's the first place I went.

Not to keep beating the jQuery horse, but if jQuery is referencing the radio 
button by ID or some other non-positional selector, the layout shouldn't matter.

Just to be sure, I wrote up a quick little test with 2 sets of radio buttons.  
This works find in FireFox and IE7:

script type=text/javascript src=jquery-1.2.6.min.js/script
script type=text/javascript
$(document).ready(function() {

$(input[type='radio'][name='radio1']).click(function() {
var $clickedRadioButton= $(this);
if($clickedRadioButton.val()== Yes)
{
$(#radio2AA).attr(checked,true);
$(#radio2AA).attr(disabled,false);
$(#radio2BB).attr(disabled,true);
}
else
{
$(#radio2BB).attr(checked,true);
$(#radio2BB).attr(disabled,false);
$(#radio2AA).attr(disabled,true);
}
});

});

/script

form name=testForm method=post action=none
table id=table1 cellpadding=2 cellspacing=2 style=border:1px solid 
black;
tr
  td
table id=table2 cellpadding=2 cellspacing=2 
style=border:1px solid blue;
tr
  tdJust a random cell to be different./td
  td
   table id=table3 cellpadding=2 cellspacing=2 
style=border:1px solid red;
tr
 td
   Okay, in the next cell is our set of radio buttons.
 /td
td
  strongRadio #1/strongbr /
  input type=radio name=radio1 id=radio1AA 
value=Yes The answer is Yesbr /
  input type=radio name=radio1 id=radio1BB 
value=No The answer is Nobr /
hr /
strongRadio #2/strongbr /
input type=radio name=radio2 id=radio2AA 
value=Yep You just answered Yesbr /
input type=radio name=radio2 id=radio2BB 
value=Nope You just answered Nobr /
/td
/tr
/table
/td
/tr
  /table
  /td
  /tr
/table
/form

...the only reason I can think of for the layout to affect the script is if one 
or more HTML elements are not closed properly:  invalid HTML that perhaps the 
browser can compensate for and display correctly, but wrecks the DOM of the 
page.

Of course, if it's IE 6 you're talking about, all bets are off.  :)


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319293
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Javascript question

2009-02-13 Thread Scott Stewart

and that would/does work.

I don't know if it's an error with the layout or jquery can't  traverse 
nested tables or what but I've never been able to get it to function 
consistently in this layout

Brian Swartzfager wrote:
 jquery doesn't work with this layout, that's the first place I went.
 

 Not to keep beating the jQuery horse, but if jQuery is referencing the radio 
 button by ID or some other non-positional selector, the layout shouldn't 
 matter.

 Just to be sure, I wrote up a quick little test with 2 sets of radio buttons. 
  This works find in FireFox and IE7:

 script type=text/javascript src=jquery-1.2.6.min.js/script
 script type=text/javascript
   $(document).ready(function() {

   $(input[type='radio'][name='radio1']).click(function() {
   var $clickedRadioButton= $(this);
   if($clickedRadioButton.val()== Yes)
   {
   $(#radio2AA).attr(checked,true);
   $(#radio2AA).attr(disabled,false);
   $(#radio2BB).attr(disabled,true);
   }
   else
   {
   $(#radio2BB).attr(checked,true);
   $(#radio2BB).attr(disabled,false);
   $(#radio2AA).attr(disabled,true);
   }
   });

   });

 /script

 form name=testForm method=post action=none
 table id=table1 cellpadding=2 cellspacing=2 style=border:1px solid 
 black;
   tr
 td
   table id=table2 cellpadding=2 cellspacing=2 
 style=border:1px solid blue;
   tr
 tdJust a random cell to be different./td
 td
  table id=table3 cellpadding=2 cellspacing=2 
 style=border:1px solid red;
   tr
td
  Okay, in the next cell is our set of radio buttons.
/td
   td
 strongRadio #1/strongbr /
 input type=radio name=radio1 id=radio1AA 
 value=Yes The answer is Yesbr /
 input type=radio name=radio1 id=radio1BB 
 value=No The answer is Nobr /
   hr /
   strongRadio #2/strongbr /
   input type=radio name=radio2 id=radio2AA 
 value=Yep You just answered Yesbr /
   input type=radio name=radio2 id=radio2BB 
 value=Nope You just answered Nobr /
   /td
   /tr
   /table
   /td
   /tr
   /table
   /td
   /tr
 /table
 /form

 ...the only reason I can think of for the layout to affect the script is if 
 one or more HTML elements are not closed properly:  invalid HTML that perhaps 
 the browser can compensate for and display correctly, but wrecks the DOM of 
 the page.

 Of course, if it's IE 6 you're talking about, all bets are off.  :)


 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319294
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Javascript question

2009-02-13 Thread Nathan Strutz

Ok scott, you've piqued my interest. You've _got_ to share this interface
that chokes jQuery.
:)

nathan strutz
[Blog and Family @ http://www.dopefly.com/]
[AZCFUG Manager @ http://www.azcfug.org/]



On Fri, Feb 13, 2009 at 12:57 PM, Scott Stewart saste...@email.unc.eduwrote:


 and that would/does work.

 I don't know if it's an error with the layout or jquery can't  traverse
 nested tables or what but I've never been able to get it to function
 consistently in this layout

 Brian Swartzfager wrote:
  jquery doesn't work with this layout, that's the first place I went.
 
 
  Not to keep beating the jQuery horse, but if jQuery is referencing the
 radio button by ID or some other non-positional selector, the layout
 shouldn't matter.
 
  Just to be sure, I wrote up a quick little test with 2 sets of radio
 buttons.  This works find in FireFox and IE7:
 
  script type=text/javascript src=jquery-1.2.6.min.js/script
  script type=text/javascript
$(document).ready(function() {
 
$(input[type='radio'][name='radio1']).click(function() {
var $clickedRadioButton= $(this);
if($clickedRadioButton.val()== Yes)
{
$(#radio2AA).attr(checked,true);
$(#radio2AA).attr(disabled,false);
$(#radio2BB).attr(disabled,true);
}
else
{
$(#radio2BB).attr(checked,true);
$(#radio2BB).attr(disabled,false);
$(#radio2AA).attr(disabled,true);
}
});
 
});
 
  /script
 
  form name=testForm method=post action=none
  table id=table1 cellpadding=2 cellspacing=2 style=border:1px
 solid black;
tr
  td
table id=table2 cellpadding=2 cellspacing=2
 style=border:1px solid blue;
tr
  tdJust a random cell to be different./td
  td
   table id=table3 cellpadding=2 cellspacing=2
 style=border:1px solid red;
tr
 td
   Okay, in the next cell is our set of radio
 buttons.
 /td
td
  strongRadio #1/strongbr /
  input type=radio name=radio1 id=radio1AA
 value=Yes The answer is Yesbr /
  input type=radio name=radio1 id=radio1BB
 value=No The answer is Nobr /
hr /
strongRadio #2/strongbr /
input type=radio name=radio2 id=radio2AA
 value=Yep You just answered Yesbr /
input type=radio name=radio2 id=radio2BB
 value=Nope You just answered Nobr /
/td
/tr
/table
/td
/tr
/table
/td
/tr
  /table
  /form
 
  ...the only reason I can think of for the layout to affect the script is
 if one or more HTML elements are not closed properly:  invalid HTML that
 perhaps the browser can compensate for and display correctly, but wrecks the
 DOM of the page.
 
  Of course, if it's IE 6 you're talking about, all bets are off.  :)
 
 
 

 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319299
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Javascript question

2009-02-13 Thread Adrian Lynch

SHARE IT, SHARE IT, SHARE IT, SHARE IT, SHARE IT!! :OD

Go on, take out any sensitive info (but make sure the structure remains the
same).

Adrian

 -Original Message-
 From: Nathan Strutz [mailto:str...@gmail.com]
 Sent: 13 February 2009 21:50
 To: cf-talk
 Subject: Re: Javascript question
 
 
 Ok scott, you've piqued my interest. You've _got_ to share this
 interface
 that chokes jQuery.
 :)
 
 nathan strutz
 [Blog and Family @ http://www.dopefly.com/]
 [AZCFUG Manager @ http://www.azcfug.org/]
 
 
 
 On Fri, Feb 13, 2009 at 12:57 PM, Scott Stewart
 saste...@email.unc.eduwrote:
 
 
  and that would/does work.
 
  I don't know if it's an error with the layout or jquery can't
 traverse
  nested tables or what but I've never been able to get it to function
  consistently in this layout
 
  Brian Swartzfager wrote:
   jquery doesn't work with this layout, that's the first place I
 went.
  
  
   Not to keep beating the jQuery horse, but if jQuery is referencing
 the
  radio button by ID or some other non-positional selector, the layout
  shouldn't matter.
  
   Just to be sure, I wrote up a quick little test with 2 sets of
 radio
  buttons.  This works find in FireFox and IE7:
  
   script type=text/javascript src=jquery-1.2.6.min.js/script
   script type=text/javascript
 $(document).ready(function() {
  
 $(input[type='radio'][name='radio1']).click(function() {
 var $clickedRadioButton= $(this);
 if($clickedRadioButton.val()== Yes)
 {
 $(#radio2AA).attr(checked,true);
  
 $(#radio2AA).attr(disabled,false);
 $(#radio2BB).attr(disabled,true);
 }
 else
 {
 $(#radio2BB).attr(checked,true);
  
 $(#radio2BB).attr(disabled,false);
 $(#radio2AA).attr(disabled,true);
 }
 });
  
 });
  
   /script
  
   form name=testForm method=post action=none
   table id=table1 cellpadding=2 cellspacing=2
 style=border:1px
  solid black;
 tr
   td
 table id=table2 cellpadding=2 cellspacing=2
  style=border:1px solid blue;
 tr
   tdJust a random cell to be different./td
   td
table id=table3 cellpadding=2 cellspacing=2
  style=border:1px solid red;
 tr
  td
Okay, in the next cell is our set of radio
  buttons.
  /td
 td
   strongRadio #1/strongbr /
   input type=radio name=radio1
 id=radio1AA
  value=Yes The answer is Yesbr /
   input type=radio name=radio1
 id=radio1BB
  value=No The answer is Nobr /
 hr /
 strongRadio #2/strongbr /
 input type=radio name=radio2
 id=radio2AA
  value=Yep You just answered Yesbr /
 input type=radio name=radio2
 id=radio2BB
  value=Nope You just answered Nobr /
 /td
 /tr
 /table
 /td
 /tr
 /table
 /td
 /tr
   /table
   /form
  
   ...the only reason I can think of for the layout to affect the
 script is
  if one or more HTML elements are not closed properly:  invalid HTML
 that
  perhaps the browser can compensate for and display correctly, but
 wrecks the
  DOM of the page.
  
   Of course, if it's IE 6 you're talking about, all bets are off.  :)


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319301
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


re: CF / Javascript question

2008-12-19 Thread Jenny Gavin-Wear
Yes, that is one option and would be really easy to do, just would be really
sweet to do it with the scrolling div (or textarea) though.



-Original Message-
From: CF Developer [mailto:coldfus...@mindkeeper.net]
Sent: 17 December 2008 15:22
To: cf-talk
Subject: SPAM-HIGH re: CF / Javascript question



Why not place a checkbox on the page (after the textarea) 
indicating:

[ ] I have read the prescribed text.

If the box is checked, fire off a JS to enable the Continue button, else
keep it disabled.

Just a thought!



From: Jenny Gavin-Wear 
jenn...@fasttrackonline.co.uk
Sent: Wednesday, December 17, 2008 6:54 AM
To: cf-talk cf-talk@houseoffusion.com
Subject: CF / Javascript question

Hi all,

In a registration procedure, I need to do a verification that the person
registering has read a large piece of text.

The way I thought about doing is is with a scrolling div area which enables
a continue to next page option when the user has scrolled to the bottom of
the text.

How could I best go about this using CF and/or javascript, please?

Grateful for any ideas ...

Jenny





~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316957
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


re: CF / Javascript question

2008-12-17 Thread CF Developer

Why not place a checkbox on the page (after the textarea) 
indicating: 

[ ] I have read the prescribed text.

If the box is checked, fire off a JS to enable the Continue button, else keep 
it disabled.

Just a thought!



From: Jenny Gavin-Wear 
jenn...@fasttrackonline.co.uk
Sent: Wednesday, December 17, 2008 6:54 AM
To: cf-talk cf-talk@houseoffusion.com
Subject: CF / Javascript question 

Hi all,

In a registration procedure, I need to do a verification that the person
registering has read a large piece of text.

The way I thought about doing is is with a scrolling div area which enables
a continue to next page option when the user has scrolled to the bottom of
the text.

How could I best go about this using CF and/or javascript, please?

Grateful for any ideas ...

Jenny



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316865
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


CF / Javascript question

2008-12-17 Thread Jenny Gavin-Wear
Hi all,

In a registration procedure, I need to do a verification that the person
registering has read a large piece of text.

The way I thought about doing is is with a scrolling div area which enables
a continue to next page option when the user has scrolled to the bottom of
the text.

How could I best go about this using CF and/or javascript, please?

Grateful for any ideas ...

Jenny




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316863
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CF / Javascript question

2008-12-17 Thread Ravi Gehlot
Jenny,

Great question. It is not really easy to accomplish what you have in 
mind. I understand that you want the user to scroll down in order to 
show a button for continue. Dzone.com has a great example of how you can 
scroll down using javascript. If you can get the position where it 
stops, perhaps you can pass that as an argument to enable your button. I 
am not sure how to do it though. This is just my thought. Check this 
article for more information: 
http://www.jaisenmathai.com/blog/2008/02/18/eliminate-paging-results-by-using-javascript-ala-dzone/

Just my $0.02 cents,
Ravi.




Jenny Gavin-Wear wrote:
 Hi all,

 In a registration procedure, I need to do a verification that the person
 registering has read a large piece of text.

 The way I thought about doing is is with a scrolling div area which enables
 a continue to next page option when the user has scrolled to the bottom of
 the text.

 How could I best go about this using CF and/or javascript, please?

 Grateful for any ideas ...

 Jenny




 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316866
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: OT JavaScript question.

2008-11-12 Thread Cutter (CFRelated)
var myObj = {
  variableA: 'some value',
  variableB: 12,
  variableC: function(){
   // a function
  }
};

I think, you'll want to test.

Steve Cutter Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer
_
http://blog.cutterscrossing.com

Ian Skinner wrote:
 Quick question that I just can not think of the right terms to find in 
 Google.
 
 There is a syntax short cut in JavaScript if you are assigning several 
 properties to the same object.  What is it?
 
 
 
 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315159
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: OT JavaScript question.

2008-11-12 Thread Andy Matthews
You can do this:

Var something = somethingelse = onemorething = 0;

-Original Message-
From: Ian Skinner [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 12, 2008 1:34 PM
To: cf-talk
Subject: OT JavaScript question.

Quick question that I just can not think of the right terms to find in 
Google.

There is a syntax short cut in JavaScript if you are assigning several 
properties to the same object.  What is it?





~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315160
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


OT JavaScript question.

2008-11-12 Thread Ian Skinner
Quick question that I just can not think of the right terms to find in 
Google.

There is a syntax short cut in JavaScript if you are assigning several 
properties to the same object.  What is it?



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315158
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: OT JavaScript question.

2008-11-12 Thread Adrian Lynch
Or do you mean with?

with someObject {
var1 = not;
var2 = sure;
var3 = about;
var4 = this;
var5 = syntax;
var6 = or;
var7 = whether;
var8 = it's a JavaScript;
var9 = thing or not;
}

alert(someObject.var1);

Adrian
Building a database of ColdFusion errors at http://cferror.org/

-Original Message-
From: Ian Skinner
Sent: 12 November 2008 19:34
To: cf-talk
Subject: OT JavaScript question.


Quick question that I just can not think of the right terms to find in 
Google.

There is a syntax short cut in JavaScript if you are assigning several 
properties to the same object.  What is it?

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315161
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: OT JavaScript question.

2008-11-12 Thread Ian Skinner
Adrian Lynch wrote:
 Or do you mean with?

 with someObject {
   var1 = not;
   var2 = sure;
   var3 = about;
   var4 = this;
   var5 = syntax;
   var6 = or;
   var7 = whether;
   var8 = it's a JavaScript;
   var9 = thing or not;
 }

 alert(someObject.var1);

Yes that is the one I was looking for!.  I found 'with' to be a very 
poor search term on Google, or any search engine for that matter.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315167
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: OT JavaScript question.

2008-11-12 Thread Charlie Griefer
On Wed, Nov 12, 2008 at 1:14 PM, Ian Skinner [EMAIL PROTECTED] wrote:


 Yes that is the one I was looking for!.  I found 'with' to be a very
 poor search term on Google, or any search engine for that matter.


heh.  reminds me of http://bash.org/?514353 :)

-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315168
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: OT JavaScript question.

2008-11-12 Thread Jim Davis
 -Original Message-
 From: Ian Skinner [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 12, 2008 4:15 PM
 To: cf-talk
 Subject: Re: OT JavaScript question.
 
 Adrian Lynch wrote:
  Or do you mean with?
 
  with someObject {
  var1 = not;
  var2 = sure;
  var3 = about;
  var4 = this;
  var5 = syntax;
  var6 = or;
  var7 = whether;
  var8 = it's a JavaScript;
  var9 = thing or not;
  }
 
  alert(someObject.var1);
 
 Yes that is the one I was looking for!.  I found 'with' to be a very
 poor search term on Google, or any search engine for that matter.

The actual, factual name of this is Object Literal Notation - Google
should be more cooperative with that.  ;^)

Jim Davis


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315176
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


javascript question

2008-08-14 Thread BJ McShane
I built a form for my users where they enter IP addresses.  They are use to 
putting in the .(period) in between the numbers but I built the form so all 
they would have to do is type in the number.  Is there a way I can change the 
keystroke of a . (period) to a tab.  So when they are typing they could type in 
the . but it would tab over to the next field?

thanks for any help,

bj 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310974
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: javascript question

2008-08-14 Thread Andy Matthews
Why not just have it all in one form field? Easier to store, easier to
manage, no extra coding needed. 

-Original Message-
From: BJ McShane [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2008 10:25 AM
To: CF-Talk
Subject: javascript question

I built a form for my users where they enter IP addresses.  They are use to
putting in the .(period) in between the numbers but I built the form so all
they would have to do is type in the number.  Is there a way I can change
the keystroke of a . (period) to a tab.  So when they are typing they could
type in the . but it would tab over to the next field?

thanks for any help,

bj 



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310978
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: javascript question

2008-08-14 Thread Dave Phillips
BJ,

Yes, there is a way you can do that.  I'm not sure of the exact syntax, but
hopefully you can google this and get a solution:

You need to use the onkeypress event, something like this:

input type=text name=whatever onkeypress=changePeriod();

Your changePeriod() function should look at the window.event.keyCode (which
is the ascii value of the key pressed) and it matches the ascii value of a
period (46), change it to a tab (9).  Something like this might work:

function changePeriod() {
  if(window.event.keyCode == 46) {
window.event.keyCode = 9;
  }
}

Try that and see if it works.  I know it will work in IE, but not sure about
other browsers.  

Hope this helps!

Sincerely,

Dave Phillips
http://www.dave-phillips.com


-Original Message-
From: BJ McShane [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2008 10:25 AM
To: CF-Talk
Subject: javascript question

I built a form for my users where they enter IP addresses.  They are use to
putting in the .(period) in between the numbers but I built the form so all
they would have to do is type in the number.  Is there a way I can change
the keystroke of a . (period) to a tab.  So when they are typing they could
type in the . but it would tab over to the next field?

thanks for any help,

bj 



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310983
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: javascript question

2008-08-14 Thread Yuliang Ruan
remember that when you do this, it changes the behavior of the keystroke in the 
entire window.   If you have another field that can input a period(.), this 
will make it a tab too.  

Not sure if you're allowed to check focus and based on the focused element, 
maybe make a decision to bypass or not 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310985
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: javascript question

2008-08-14 Thread Yuliang Ruan
oh wait n/m   the way dave has it, it only activates on that element.  :) 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310986
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: javascript question

2008-08-14 Thread BJ McShane
Dave thanks for the input.  I did do some google searches on this but never 
found a solution that would work. I'll try what you posted and try some more 
searches to see what I can find.
thanks! 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310990
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: javascript question

2008-08-14 Thread BJ McShane
Yes I did take that into account. If I keep in at the input tag level I think 
it should only effect the fields I want.  I'll have to do more testing.

thanks, 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310992
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: javascript question

2008-08-14 Thread BJ McShane
I'll probably change it that way.  I stored it in 4 different field in the DB 
since each of the 4 parts mean certain things to the user. They could search 
and sort based on what they are trying to find.  Also when they search they can 
just put input into any of the fields to find all the IPs with that number. So 
if the third part of the IP address is 10 they could just input something in 
the 3rd input box. 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310987
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: javascript question

2008-08-14 Thread William Seiter
If the code isn't cross-browser compatible (not tested, probably is though)

You could use the same concept to activate the javascript , when the javascript 
senses the key that was pressed, if it was the 'period' then have the element's 
'tabindex' detected and then have the system 'focus()' on the next tabindex and 
'return false' for the keystroke. 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311002
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


(ot) Javascript Question...

2008-05-16 Thread Che Vilnonis
I have a form that posts to itself. Once submitted, I create a dynamic url
on the fly.
Using javascript, how can I submit the form to itself and open the new url
in another browser window?

Can this be done w/o creating a 'go between' cf template?

Thanks, Che


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305519
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: (ot) Javascript Question...

2008-05-16 Thread Bobby Hartsfield
window.open()

most popup blockers will block it though.

..:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com


-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 16, 2008 4:14 PM
To: CF-Talk
Subject: (ot) Javascript Question...

I have a form that posts to itself. Once submitted, I create a dynamic url
on the fly.
Using javascript, how can I submit the form to itself and open the new url
in another browser window?

Can this be done w/o creating a 'go between' cf template?

Thanks, Che




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305524
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: (ot) Javascript Question...

2008-05-16 Thread Che Vilnonis
Thanks. Because of popup blockers I guess a regular href will have to do. 

-Original Message-
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 16, 2008 4:21 PM
To: CF-Talk
Subject: RE: (ot) Javascript Question...

window.open()

most popup blockers will block it though.

...:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com


-Original Message-
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: Friday, May 16, 2008 4:14 PM
To: CF-Talk
Subject: (ot) Javascript Question...

I have a form that posts to itself. Once submitted, I create a dynamic url
on the fly.
Using javascript, how can I submit the form to itself and open the new url
in another browser window?

Can this be done w/o creating a 'go between' cf template?

Thanks, Che






~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305526
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


stupid cfscript/javascript question

2008-02-06 Thread Scott Stewart
I’ve completely forgotten how to do this….

I have this script

cfscript

function show_new(dt)

 

{

 

if(DateDiff(d,dt,Now()) LT 30)

 

{  return 'font color=redNew!/font';  };

 

 

 

return '';

 

}

 

/cfscript

 

I need to call it inside a li tag

 

li style=list-style-type:square; margin-left:-18px; margin-right: 8px; 

 

How do I do this….

sas

 

 

 

-- 

 

Scott Stewart

ColdFusion Developer

SSTWebworks

4405 Oakshyre Way

Raleigh, NC. 27616

(919) 874-6229 (home)

(703) 220-2835 (cell)

 

 

 


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.20/1260 - Release Date: 2/5/2008
9:44 AM
 


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298332
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: stupid cfscript/javascript question

2008-02-06 Thread Dave Watts
 I have this script
 
 cfscript
 
 function show_new(dt)

 ...

 I need to call it inside a li tag  
 
 li style=list-style-type:square; margin-left:-18px; 
 margin-right: 8px; 

li ...cfoutput#show_new(your_date_variable)#/cfoutput/li

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Training: Adobe/Google/Paperthin Certified Partners
http://training.figleaf.com/

WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers!
http://www.webmaniacsconference.com/

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298334
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: stupid cfscript/javascript question

2008-02-06 Thread Adrian Lynch
Call it inline

liMy list itemscript
type=text/javascriptmyFunctionCall();/script/li

Nothing to do with your problem, but check out jQuery if you want an easier
life with JS.

Adrian

-Original Message-
From: Scott Stewart
Sent: 06 February 2008 16:43
To: CF-Talk
Subject: stupid cfscript/javascript question


I’ve completely forgotten how to do this….

I have this script

cfscript

function show_new(dt)



{



if(DateDiff(d,dt,Now()) LT 30)



{  return 'font color=redNew!/font';  };







return '';



}



/cfscript



I need to call it inside a li tag



li style=list-style-type:square; margin-left:-18px; margin-right: 8px; 



How do I do this….

sas







--



Scott Stewart

ColdFusion Developer

SSTWebworks

4405 Oakshyre Way

Raleigh, NC. 27616

(919) 874-6229 (home)


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298333
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: stupid cfscript/javascript question

2008-02-06 Thread Andy Matthews
li#show_new(value)#/li 

-Original Message-
From: Scott Stewart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 06, 2008 10:43 AM
To: CF-Talk
Subject: stupid cfscript/javascript question

I've completely forgotten how to do this..

I have this script

cfscript

function show_new(dt)

 

{

 

if(DateDiff(d,dt,Now()) LT 30)

 

{  return 'font color=redNew!/font';  };

 

 

 

return '';

 

}

 

/cfscript

 

I need to call it inside a li tag

 

li style=list-style-type:square; margin-left:-18px; margin-right: 8px; 

 

How do I do this..

sas

 

 

 

-- 

 

Scott Stewart

ColdFusion Developer

SSTWebworks

4405 Oakshyre Way

Raleigh, NC. 27616

(919) 874-6229 (home)

(703) 220-2835 (cell)

 

 

 


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.20/1260 - Release Date: 2/5/2008
9:44 AM
 




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298337
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: stupid cfscript/javascript question

2008-02-06 Thread gary gilbert
li style=list-style-type:square; margin-left:-18px; margin-right: 8px; 
cfoutput
#show_new(dt)#
/cfoutput
/li


-- 
Gary Gilbert
http://www.garyrgilbert.com/blog


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298336
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: stupid cfscript/javascript question

2008-02-06 Thread Adrian Lynch
*whistles*

I hope no one see my reply :OS

*whistles*

-Original Message-
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: 06 February 2008 16:49
To: CF-Talk
Subject: RE: stupid cfscript/javascript question


Call it inline

liMy list itemscript
type=text/javascriptmyFunctionCall();/script/li

Nothing to do with your problem, but check out jQuery if you want an easier
life with JS.

Adrian

-Original Message-
From: Scott Stewart
Sent: 06 February 2008 16:43
To: CF-Talk
Subject: stupid cfscript/javascript question


I’ve completely forgotten how to do this….

I have this script

cfscript

function show_new(dt)



{



if(DateDiff(d,dt,Now()) LT 30)



{  return 'font color=redNew!/font';  };







return '';



}



/cfscript



I need to call it inside a li tag



li style=list-style-type:square; margin-left:-18px; margin-right: 8px; 



How do I do this….

sas







--



Scott Stewart

ColdFusion Developer

SSTWebworks

4405 Oakshyre Way

Raleigh, NC. 27616

(919) 874-6229 (home)




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298340
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: stupid cfscript/javascript question

2008-02-06 Thread Scott Stewart
Thanks all...

Sorry for the brain fart

-- 
Scott Stewart
ColdFusion Developer
 
SSTWebworks
4405 Oakshyre Way
Raleigh, NC. 27616
(919) 874-6229 (home)
(703) 220-2835 (cell)

-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 06, 2008 11:55 AM
To: CF-Talk
Subject: RE: stupid cfscript/javascript question

li#show_new(value)#/li 

-Original Message-
From: Scott Stewart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 06, 2008 10:43 AM
To: CF-Talk
Subject: stupid cfscript/javascript question

I've completely forgotten how to do this..

I have this script

cfscript

function show_new(dt)

 

{

 

if(DateDiff(d,dt,Now()) LT 30)

 

{  return 'font color=redNew!/font';  };

 

 

 

return '';

 

}

 

/cfscript

 

I need to call it inside a li tag

 

li style=list-style-type:square; margin-left:-18px; margin-right: 8px; 

 

How do I do this..

sas

 

 

 

-- 

 

Scott Stewart

ColdFusion Developer

SSTWebworks

4405 Oakshyre Way

Raleigh, NC. 27616

(919) 874-6229 (home)

(703) 220-2835 (cell)

 

 

 


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.20/1260 - Release Date: 2/5/2008
9:44 AM
 






~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298343
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: stupid cfscript/javascript question

2008-02-06 Thread Bruce Sorge
Is that what I smell. I thought the guy in the cube next to me broke 
wind. :)

Bruce

Scott Stewart wrote:
 Thanks all...

 Sorry for the brain fart

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:298345
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


javascript question

2007-06-01 Thread Chad Gray
I thought this would be an easy one but I cant get it to work.

I want a text input to change value when an option in a select box is changed.

I am looping over my options in the select with database information.  Do I 
need to use something other then onChange?


script
function displayStockLevels(ID) {
document.frmDryOffset.stockLevels.value = ID;
}
/script

input type=text id=stockLevels  /

select name=NEW_Plate_to_make
cfloop query=getPlates
option 
onchange=displayStockLevels(#getPlates.ID#);#getPlates.Name#/option
/cfloop
/select   


~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade  see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279860
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: javascript question

2007-06-01 Thread Charlie Griefer
the onchange() goes into the select element.

select name=NEW_Plate_to_make
onchange=displayStockLevels(this.options[this.selectedIndex].value);
cfloop query=getPlates
 option value=#getPlates.ID##getPlates.Name#/option
/cfloop
/select

On 6/1/07, Chad Gray [EMAIL PROTECTED] wrote:
 I thought this would be an easy one but I cant get it to work.

 I want a text input to change value when an option in a select box is changed.

 I am looping over my options in the select with database information.  Do I 
 need to use something other then onChange?


 script
 function displayStockLevels(ID) {
 document.frmDryOffset.stockLevels.value = ID;
 }
 /script

 input type=text id=stockLevels  /

 select name=NEW_Plate_to_make
 cfloop query=getPlates
 option 
 onchange=displayStockLevels(#getPlates.ID#);#getPlates.Name#/option
 /cfloop
 /select


 

~|
Macromedia ColdFusion MX7
Upgrade to MX7  experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279861
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: javascript question

2007-06-01 Thread Chad Gray
Oh... duh!  Thanks for the help Charlie that works great!



-Original Message-
From: Charlie Griefer [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 01, 2007 3:39 PM
To: CF-Talk
Subject: Re: javascript question

the onchange() goes into the select element.

select name=NEW_Plate_to_make
onchange=displayStockLevels(this.options[this.selectedIndex].value);
cfloop query=getPlates
 option value=#getPlates.ID##getPlates.Name#/option
/cfloop
/select

On 6/1/07, Chad Gray [EMAIL PROTECTED] wrote:
 I thought this would be an easy one but I cant get it to work.

 I want a text input to change value when an option in a select box is changed.

 I am looping over my options in the select with database information.  Do I 
 need to use something other then onChange?


 script
 function displayStockLevels(ID) {
 document.frmDryOffset.stockLevels.value = ID;
 }
 /script

 input type=text id=stockLevels  /

 select name=NEW_Plate_to_make
 cfloop query=getPlates
 option 
 onchange=displayStockLevels(#getPlates.ID#);#getPlates.Name#/option
 /cfloop
 /select


 



~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279863
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


OT: Javascript Question

2007-04-12 Thread Scott Stewart
Hey all, 

 

 

How would I control a select tag based on this.

 

function updateSelectedJournals(responseStruct) {

$('selectedJournals').innerHTML = Selected Journals
(+responseStruct.total+);

$('lstSelectedTerms').innerHTML = responseStruct.lstoutput;

 

 

I have select name=opoptionOR/optionoptionAND/option/select 

I want the and to show up if repsonseStruct.total is greater than 1.

 

Thanks

 

sas

 

 

-- 

Scott Stewart

ColdFusion Developer

 

SSTWebworks

7241 Jillspring Ct.

Springfield, Va. 22152

(703) 220-2835

 

http://www.sstwebworks.com

 



~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade  see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275082
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Javascript Question

2007-04-12 Thread Scott Stewart
Never mind, I figured it out

-- 
Scott Stewart
ColdFusion Developer
 
SSTWebworks
7241 Jillspring Ct.
Springfield, Va. 22152
(703) 220-2835
 
http://www.sstwebworks.com
-Original Message-
From: Scott Stewart [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 12, 2007 10:52 AM
To: CF-Talk
Subject: OT: Javascript Question

Hey all, 

 

 

How would I control a select tag based on this.

 

function updateSelectedJournals(responseStruct) {

$('selectedJournals').innerHTML = Selected Journals
(+responseStruct.total+);

$('lstSelectedTerms').innerHTML = responseStruct.lstoutput;

 

 

I have select name=opoptionOR/optionoptionAND/option/select 

I want the and to show up if repsonseStruct.total is greater than 1.

 

Thanks

 

sas

 

 

-- 

Scott Stewart

ColdFusion Developer

 

SSTWebworks

7241 Jillspring Ct.

Springfield, Va. 22152

(703) 220-2835

 

http://www.sstwebworks.com

 





~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7  
Flex 2
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275089
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


OT: Javascript Question

2007-03-07 Thread Brad Wood
Hi guys, I've got a JavaScript question which has me puzzled.  Can an
instance of a JavaScript object know the name of its instance?

 

That might not make any sense, so I have some quick sample code.
Consider the following:

 

SCRIPT LANGUAGE=JavaScript TYPE=text/javascript

 

customObject = function()

{

}



customObject.prototype.whoAmI = function()

{

return 'My instance name is ' + ??;

}

 

myObject = new customObject();

 

alert(myObject.whoAmI());



/SCRIPT

 

What would I need to replace the ?? with to make the output say My
instance name is myObject?

this.something??

 

I don't even know if this is possible, but in theory I might have
several instances of the same object in the page and I want to know if
they can be smart enough to know which one they are.

 

~Brad



~|
Create Web Applications With ColdFusion MX7  Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271954
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Javascript Question

2007-03-07 Thread Dave Watts
  Can an instance of a JavaScript object know the name of 
 its instance?

My understanding is that it generally can't; this makes sense, since an
object may have more than one reference.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade  see new features.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271957
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Javascript Question

2007-03-07 Thread Brad Wood
By more that one reference do you mean more than one instance, or more
than one pointer to the same instance?

~Brad


My understanding is that it generally can't; this makes sense, since an
object may have more than one reference.


~|
Create Web Applications With ColdFusion MX7  Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271958
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Javascript Question

2007-03-07 Thread Jim Davis
 -Original Message-
 From: Brad Wood [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 07, 2007 10:53 PM
 To: CF-Talk
 Subject: OT: Javascript Question
 
 Hi guys, I've got a JavaScript question which has me puzzled.  Can an
 instance of a JavaScript object know the name of its instance?

No - there's really no way to do things as you're talking about it.

Take a line like this:

var foo = new MyObject();

Well - foo is just a pointer to the new object - it has no real affect on
it in any way.

You might consider foo to be the object - and want a function or property
to remember it.  But that really doesn't make any sense when you think about
it.  Consider this:

var foo = new MyObject();
var faa = foo;
var fii = faa;

or

var foo,faa,fii = new MyObject();

There is no difference at all between foo, faa and fii - they are all
equal references to the object.  What would WhoAmI() return?

Now - all that said, you can sort of do this with a custom assignment
function of some kind.

For example you could easily pass an ID on object creation like this:

var foo = new MyObject(foo);

You might also be able to (I'm not sure) create a function which can inject
your new variable into a passed scope... but I've not tried it. But since
functions are both data and objects something like this might work:

createMyObject(foo);

This would do something like this (from memory, forgive me if I've got
things muddled):

Function createMyObject(varName) {
caller[varName] = new MyObject();
caller[varName].InstanceName = varName;
};

That's not very elegant - but you might be able to come up with a decent
abstraction.

Finally I think the best way to do what you're talking about is just to
manage your instances.  I use custom collection objects to manage related
groups of objects.  I've put them online here:

http://www.depressedpress.com/Content/Development/JavaScript/Extensions/Inde
x.cfm

Look at DP_ObCollection (for managing unordered lists) and
DP_ObCollectionOrdered (for managing ordered lists).  These assume that
the member objects are of the same type and have a property to use as a key
name.  Once you set that up can retrieve any of the members by name using a
get() method.  You can loop over the collection in multiple ways and
basically treat the collection as a single unit.

I'm not sure what you're trying to do in the end, but I find those
collection components useful over and over again.

Jim DAvis 





~|
Create Web Applications With ColdFusion MX7  Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271959
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Javascript Question

2007-03-07 Thread Dave Watts
 By more that one reference do you mean more than one 
 instance, or more than one pointer to the same instance?

The latter. Jim just explained it better than I did. But he's probably not
typing with his thumbs!

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~|
Macromedia ColdFusion MX7
Upgrade to MX7  experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271960
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Javascript Question

2007-03-07 Thread Brad Wood
Lol.  It all makes perfect sense.

~Brad


~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7  
Flex 2. 
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271961
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


SOT: JavaScript question.

2006-12-20 Thread Ian Skinner
Is there any way to restrict a getElementByTag() function to a subsection of 
the DOM?

I.E.  Only return div tags that are children of the contacts fiedset node?

I've tried a couple of nebulous attempts at this with no success.

--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 



~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264645
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: JavaScript question.

2006-12-20 Thread Andy Matthews
Using jQuery this would be a snap:

$('fieldsent#contacts div');

Assuming that the fieldset tag had an ID of contacts.

!//--
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--//-

-Original Message-
From: Ian Skinner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 20, 2006 2:33 PM
To: CF-Talk
Subject: SOT: JavaScript question.


Is there any way to restrict a getElementByTag() function to a subsection of
the DOM?

I.E.  Only return div tags that are children of the contacts fiedset node?

I've tried a couple of nebulous attempts at this with no success.

--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-

C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.





~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264646
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: SOT: JavaScript question.

2006-12-20 Thread Qasim Rasheed
Prototype  (JS) library has a built in function named $$() for this purpose.
You can also use this implementation

http://simon.incutio.com/archive/2003/03/25/getElementsBySelector

HTH

On 12/20/06, Ian Skinner [EMAIL PROTECTED] wrote:

 Is there any way to restrict a getElementByTag() function to a subsection
 of the DOM?

 I.E.  Only return div tags that are children of the contacts fiedset
 node?

 I've tried a couple of nebulous attempts at this with no success.

 --
 Ian Skinner
 Web Programmer
 BloodSource
 www.BloodSource.org
 Sacramento, CA

 -
 | 1 |   |
 -  Binary Soduko
 |   |   |
 -

 C code. C code run. Run code run. Please!
 - Cynthia Dunning

 Confidentiality Notice:  This message including any
 attachments is for the sole use of the intended
 recipient(s) and may contain confidential and privileged
 information. Any unauthorized review, use, disclosure or
 distribution is prohibited. If you are not the
 intended recipient, please contact the sender and
 delete any copies of this message.



 

~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264647
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: SOT: JavaScript question.

2006-12-20 Thread Ryan Stille
Ian Skinner wrote:
 Is there any way to restrict a getElementByTag() function to a subsection of 
 the DOM?

 I.E.  Only return div tags that are children of the contacts fiedset node?

 I've tried a couple of nebulous attempts at this with no success.
   
I don't know how getElementsByTag() differs from getElementsByTagName, 
but you can call the later on a node.

nodes = getElementById('yourdiv').getElementsByTagName('p');

Ryan Stille
CF WebTools
http://ryan.cfwebtools.com



~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264648
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: SOT: JavaScript question.

2006-12-20 Thread Ian Skinner
I don't know how getElementsByTag() differs from getElementsByTagName, 
but you can call the later on a node.

nodes = getElementById('yourdiv').getElementsByTagName('p');

Thanks, I thought I tried something like this, but I will give it another go.

getElementsByTag() differs from getElementsByTagName() in that the former is my 
mistyping of the latter!  :-)  I am so waiting for that type what I meant to 
type spell checker!

--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264650
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: SOT: JavaScript question.

2006-12-20 Thread Joshua Cyr
I just did something like that to detect clicks on links only within one Div
tag.  Used yahoo's dom and event js and spry for the tabs.

http://dev.besavvy.com/Spry_P1_4_1214/samples/tabbedpanels/tabbed_panel_samp
le.cfm

The guts are:

function clickHandler(e) {  
 var elTarget = YAHOO.util.Event.getTarget(e);  
 
 while (elTarget.id != TabbedPanels1) {
if(elTarget.nodeName.toUpperCase() == A) {
if(elTarget.href.indexOf('dev.besavvy.com') != -1) {
 Spry.Utils.updateContent('apDiv1',elTarget);
YAHOO.util.Event.preventDefault(e);
break;
}
else {
break;
}
} else {

elTarget = elTarget.parentNode;
}
}



}
YAHOO.example.init = function() {
YAHOO.util.Event.on(YAHOO.util.Dom.getElementsByClassName('joshua',
'div')[0], click, clickHandler);
} 


Joshua Cyr
Savvy Software
866.870.6358
www.besavvy.com

-Original Message-
From: Ian Skinner [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 20, 2006 3:47 PM
To: CF-Talk
Subject: RE: SOT: JavaScript question.

I don't know how getElementsByTag() differs from getElementsByTagName, but
you can call the later on a node.

nodes = getElementById('yourdiv').getElementsByTagName('p');

Thanks, I thought I tried something like this, but I will give it another
go.

getElementsByTag() differs from getElementsByTagName() in that the former is
my mistyping of the latter!  :-)  I am so waiting for that type what I
meant to type spell checker!

--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any attachments is for the
sole use of the intended
recipient(s) and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited. If you
are not the intended recipient, please contact the sender and delete any
copies of this message. 






~|
Create robust enterprise, web RIAs.
Upgrade  integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264653
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


OT: Javascript question

2006-05-25 Thread Tony
Hi there... this should be quick and easy for you Jscript ninja's...

in this line:
marker.openInfoWindowHtml(#url.address# #url.city# #url.state#
#url.zip# Report time: #url.time# Report Date: #url.date# );

i want to put BR's so that the text, line breaks, and the pop up
window isnt huge.

any idea how to add that into the string, so that it doesnt break it?


script type=text/javascript
//![CDATA[
cfoutput
function load() {
  if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById(map));
map.setCenter(new GLatLng(#insert('.',url.lat,2)#,
#insert('.',url.lon,3)#), 13);
map.addControl(new GLargeMapControl ());
map.addControl(new GMapTypeControl());  

// Creates a marker at the given point with the 
given number label
function createMarker(point, number) {
  var marker = new GMarker(point);
  GEvent.addListener(marker, click, 
function() {
marker.openInfoWindowHtml(#url.address# 
#url.city#
#url.state# #url.zip# Report time: #url.time# Report Date: #url.date#
);
  });
  return marker;
}   
// Add 1 markers to the map
for (var i = 0; i  1; i++) {
  var point = new 
GLatLng(#insert('.',url.lat,2)#, #insert('.',url.lon,3)#);
  map.addOverlay(createMarker(point, i + 1));
}
  }
}
/cfoutput
//]]
   /script


thanks!
tony

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241496
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


NEVERMIND, thanks! Re: OT: Javascript question

2006-05-25 Thread Tony
nevermind, it works now, i guess i had another problem the day i was testing
this, and that was not the issue.

it works all good.

thanks!
tony

On 5/25/06, Tony [EMAIL PROTECTED] wrote:
 Hi there... this should be quick and easy for you Jscript ninja's...

 in this line:
 marker.openInfoWindowHtml(#url.address# #url.city# #url.state#
 #url.zip# Report time: #url.time# Report Date: #url.date# );

 i want to put BR's so that the text, line breaks, and the pop up
 window isnt huge.

 any idea how to add that into the string, so that it doesnt break it?


 script type=text/javascript
 //![CDATA[
 cfoutput
 function load() {
   if (GBrowserIsCompatible()) {
 var map = new GMap2(document.getElementById(map));
 map.setCenter(new GLatLng(#insert('.',url.lat,2)#,
 #insert('.',url.lon,3)#), 13);
 map.addControl(new GLargeMapControl ());
 map.addControl(new GMapTypeControl());
 // Creates a marker at the given point with 
 the given number label
 function createMarker(point, number) {
   var marker = new GMarker(point);
   GEvent.addListener(marker, click, 
 function() {
 marker.openInfoWindowHtml(#url.address# 
 #url.city#
 #url.state# #url.zip# Report time: #url.time# Report Date: #url.date#
 );
   });
   return marker;
 }
 // Add 1 markers to the map
 for (var i = 0; i  1; i++) {
   var point = new 
 GLatLng(#insert('.',url.lat,2)#, #insert('.',url.lon,3)#);
   map.addOverlay(createMarker(point, i + 1));
 }
   }
 }
 /cfoutput
 //]]
/script


 thanks!
 tony


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241497
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: OT: Javascript question

2006-05-25 Thread Michael Traher
try dropping #chr(10)# into the string, I think that will work.

might be nicer to set one display variable earlier
cfset infoText = url.address  chr(10)  url.city  chr(10)
then you can just refer to #infoText in the js.

On 5/25/06, Tony [EMAIL PROTECTED] wrote:

 Hi there... this should be quick and easy for you Jscript ninja's...

 in this line:
 marker.openInfoWindowHtml(#url.address# #url.city# #url.state#
 #url.zip# Report time: #url.time# Report Date: #url.date# );

 i want to put BR's so that the text, line breaks, and the pop up
 window isnt huge.

 any idea how to add that into the string, so that it doesnt break it?


 script type=text/javascript
 //![CDATA[
 cfoutput
 function load() {
   if (GBrowserIsCompatible()) {
 var map = new GMap2(document.getElementById
 (map));
 map.setCenter(new GLatLng(#insert('.',url.lat
 ,2)#,
 #insert('.',url.lon,3)#), 13);
 map.addControl(new GLargeMapControl ());
 map.addControl(new GMapTypeControl());
 // Creates a marker at the given point
 with the given number label
 function createMarker(point, number) {
   var marker = new GMarker(point);
   GEvent.addListener(marker, click,
 function() {
 marker.openInfoWindowHtml(#url.address#
 #url.city#
 #url.state# #url.zip# Report time: #url.time# Report Date: #url.date#
 );
   });
   return marker;
 }
 // Add 1 markers to the map
 for (var i = 0; i  1; i++) {
   var point = new GLatLng(#insert('.',
 url.lat,2)#, #insert('.',url.lon,3)#);
   map.addOverlay(createMarker(point, i +
 1));
 }
   }
 }
 /cfoutput
 //]]
/script


 thanks!
 tony

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241498
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: OT: Javascript question

2006-05-25 Thread Tony
true.

its still very alpha stage...
but its very simple to change to that!

good idea.

tw

On 5/25/06, Michael Traher [EMAIL PROTECTED] wrote:
 try dropping #chr(10)# into the string, I think that will work.

 might be nicer to set one display variable earlier
 cfset infoText = url.address  chr(10)  url.city  chr(10)
 then you can just refer to #infoText in the js.

 On 5/25/06, Tony [EMAIL PROTECTED] wrote:
 
  Hi there... this should be quick and easy for you Jscript ninja's...
 
  in this line:
  marker.openInfoWindowHtml(#url.address# #url.city# #url.state#
  #url.zip# Report time: #url.time# Report Date: #url.date# );
 
  i want to put BR's so that the text, line breaks, and the pop up
  window isnt huge.
 
  any idea how to add that into the string, so that it doesnt break it?
 
 
  script type=text/javascript
  //![CDATA[
  cfoutput
  function load() {
if (GBrowserIsCompatible()) {
  var map = new GMap2(document.getElementById
  (map));
  map.setCenter(new GLatLng(#insert('.',url.lat
  ,2)#,
  #insert('.',url.lon,3)#), 13);
  map.addControl(new GLargeMapControl ());
  map.addControl(new GMapTypeControl());
  // Creates a marker at the given point
  with the given number label
  function createMarker(point, number) {
var marker = new GMarker(point);
GEvent.addListener(marker, click,
  function() {
  marker.openInfoWindowHtml(#url.address#
  #url.city#
  #url.state# #url.zip# Report time: #url.time# Report Date: #url.date#
  );
});
return marker;
  }
  // Add 1 markers to the map
  for (var i = 0; i  1; i++) {
var point = new GLatLng(#insert('.',
  url.lat,2)#, #insert('.',url.lon,3)#);
map.addOverlay(createMarker(point, i +
  1));
  }
}
  }
  /cfoutput
  //]]
 /script
 
 
  thanks!
  tony
 
 

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241537
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


OT: Javascript question...or suggestion where to go to get answer

2006-01-29 Thread Eric Roberts
I have a JavaScript dilemma in one of my CF apps and I am not sure how to
solve it.  We have popup that is used to modify some values in the database
before running a report.  We want this popup to close if you click on
another window.  I tried putting close in an onBlur event as part of the
body tag, but then when I click on any location within the window, it
closes...I guess because when you focus on one element, you are blurring
another.  Anyone have any suggestions on how to accomplish this or where I
can go to get some help with this?  Any help would be greatly appreciated.

Blessings,
Eric


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230702
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Javascript question...or suggestion where to go to get answer

2006-01-29 Thread Adrian Lynch
Only tested on IE6:

Two pages, temp.cfm and temp2.cfm

temp.cfm:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN

html
head
titleUntitled/title
script type=text/javascript

function pageLoaded() {

window.onfocus = function() {
alert(WE HAVE FOCUS);
};

window.onblur = function() {
window.close();
};

}

/script
/head

body onload=pageLoaded();

/body

/html


temp2.cfm

script
window.open(temp.cfm, aNewWindow);
/script


Seems to work but I'd test a fair bit :O)

Adrian Lynch
http://www.halestorm.co.uk/

Spring clean out:
http://www.adrianlynch.co.uk/selling/

-Original Message-
From: Eric Roberts [mailto:[EMAIL PROTECTED]
Sent: 29 January 2006 21:11
To: CF-Talk
Subject: OT: Javascript question...or suggestion where to go to get
answer


I have a JavaScript dilemma in one of my CF apps and I am not sure how to
solve it.  We have popup that is used to modify some values in the database
before running a report.  We want this popup to close if you click on
another window.  I tried putting close in an onBlur event as part of the
body tag, but then when I click on any location within the window, it
closes...I guess because when you focus on one element, you are blurring
another.  Anyone have any suggestions on how to accomplish this or where I
can go to get some help with this?  Any help would be greatly appreciated.

Blessings,
Eric




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230703
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Javascript question...or suggestion where to go to get answer

2006-01-29 Thread Eric Roberts
I will have to try that...thanks!

Eric 

-Original Message-
From: Adrian Lynch [mailto:[EMAIL PROTECTED] 
Sent: Sunday, 29 January 2006 15:32
To: CF-Talk
Subject: RE: Javascript question...or suggestion where to go to get answer

Only tested on IE6:

Two pages, temp.cfm and temp2.cfm

temp.cfm:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN

html
head
titleUntitled/title
script type=text/javascript

function pageLoaded() {

window.onfocus = function() {
alert(WE HAVE FOCUS);
};

window.onblur = function() {
window.close();
};

}

/script
/head

body onload=pageLoaded();

/body

/html


temp2.cfm

script
window.open(temp.cfm, aNewWindow);
/script


Seems to work but I'd test a fair bit :O)

Adrian Lynch
http://www.halestorm.co.uk/

Spring clean out:
http://www.adrianlynch.co.uk/selling/

-Original Message-
From: Eric Roberts [mailto:[EMAIL PROTECTED]
Sent: 29 January 2006 21:11
To: CF-Talk
Subject: OT: Javascript question...or suggestion where to go to get answer


I have a JavaScript dilemma in one of my CF apps and I am not sure how to
solve it.  We have popup that is used to modify some values in the database
before running a report.  We want this popup to close if you click on
another window.  I tried putting close in an onBlur event as part of the
body tag, but then when I click on any location within the window, it
closes...I guess because when you focus on one element, you are blurring
another.  Anyone have any suggestions on how to accomplish this or where I
can go to get some help with this?  Any help would be greatly appreciated.

Blessings,
Eric






~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230704
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Javascript question...or suggestion where to go to get answer

2006-01-29 Thread Mark Drew
I dont have the code here at home, but this is a kind of requirement  
for a modal window... i.e. a window that stops the window below it  
from gaining focus until its closed.

I have seen it implemented as a modal popup but you could also  
implement it as a div that covers the main window (I have done this  
and can try and find the code.

Basically it puts a div over EVERYTHING on the window (thus you cant  
gain access to any of the links or functions) and presents you with a  
popup that you have to close or submit so that it will go away.

Would either of these help?

Regards

Mark Drew

On 29 Jan 2006, at 22:04, Eric Roberts wrote:

 I will have to try that...thanks!

 Eric

 -Original Message-
 From: Adrian Lynch [mailto:[EMAIL PROTECTED]
 Sent: Sunday, 29 January 2006 15:32
 To: CF-Talk
 Subject: RE: Javascript question...or suggestion where to go to get  
 answer

 Only tested on IE6:

 Two pages, temp.cfm and temp2.cfm

 temp.cfm:

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN

 html
 head
   titleUntitled/title
   script type=text/javascript

   function pageLoaded() {

   window.onfocus = function() {
   alert(WE HAVE FOCUS);
   };

   window.onblur = function() {
   window.close();
   };

   }

   /script
 /head

 body onload=pageLoaded();

 /body

 /html


 temp2.cfm

 script
   window.open(temp.cfm, aNewWindow);
 /script


 Seems to work but I'd test a fair bit :O)

 Adrian Lynch
 http://www.halestorm.co.uk/

 Spring clean out:
 http://www.adrianlynch.co.uk/selling/

 -Original Message-
 From: Eric Roberts [mailto:[EMAIL PROTECTED]
 Sent: 29 January 2006 21:11
 To: CF-Talk
 Subject: OT: Javascript question...or suggestion where to go to get  
 answer


 I have a JavaScript dilemma in one of my CF apps and I am not sure  
 how to
 solve it.  We have popup that is used to modify some values in the  
 database
 before running a report.  We want this popup to close if you click on
 another window.  I tried putting close in an onBlur event as part  
 of the
 body tag, but then when I click on any location within the window, it
 closes...I guess because when you focus on one element, you are  
 blurring
 another.  Anyone have any suggestions on how to accomplish this or  
 where I
 can go to get some help with this?  Any help would be greatly  
 appreciated.

 Blessings,
 Eric






 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230710
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Javascript question...or suggestion where to go to get answer

2006-01-29 Thread Eric Roberts
No...it has to go away when the focus is lost.  The main page allows you to
change parameters that determine what is accessed in the popup.  We want to
make it as simple as possible as the folks who are using this are not
necessarily technically adept.  If the example that was given before doesn't
work, however, I may have to use something like this though.

Thanks!

Eric

-Original Message-
From: Mark Drew [mailto:[EMAIL PROTECTED] 
Sent: Sunday, 29 January 2006 18:51
To: CF-Talk
Subject: Re: Javascript question...or suggestion where to go to get answer

I dont have the code here at home, but this is a kind of requirement for a
modal window... i.e. a window that stops the window below it from gaining
focus until its closed.

I have seen it implemented as a modal popup but you could also implement it
as a div that covers the main window (I have done this and can try and find
the code.

Basically it puts a div over EVERYTHING on the window (thus you cant gain
access to any of the links or functions) and presents you with a popup that
you have to close or submit so that it will go away.

Would either of these help?

Regards

Mark Drew

On 29 Jan 2006, at 22:04, Eric Roberts wrote:

 I will have to try that...thanks!

 Eric

 -Original Message-
 From: Adrian Lynch [mailto:[EMAIL PROTECTED]
 Sent: Sunday, 29 January 2006 15:32
 To: CF-Talk
 Subject: RE: Javascript question...or suggestion where to go to get 
 answer

 Only tested on IE6:

 Two pages, temp.cfm and temp2.cfm

 temp.cfm:

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN

 html
 head
   titleUntitled/title
   script type=text/javascript

   function pageLoaded() {

   window.onfocus = function() {
   alert(WE HAVE FOCUS);
   };

   window.onblur = function() {
   window.close();
   };

   }

   /script
 /head

 body onload=pageLoaded();

 /body

 /html


 temp2.cfm

 script
   window.open(temp.cfm, aNewWindow); /script


 Seems to work but I'd test a fair bit :O)

 Adrian Lynch
 http://www.halestorm.co.uk/

 Spring clean out:
 http://www.adrianlynch.co.uk/selling/

 -Original Message-
 From: Eric Roberts [mailto:[EMAIL PROTECTED]
 Sent: 29 January 2006 21:11
 To: CF-Talk
 Subject: OT: Javascript question...or suggestion where to go to get  
 answer


 I have a JavaScript dilemma in one of my CF apps and I am not sure  
 how to
 solve it.  We have popup that is used to modify some values in the  
 database
 before running a report.  We want this popup to close if you click on
 another window.  I tried putting close in an onBlur event as part  
 of the
 body tag, but then when I click on any location within the window, it
 closes...I guess because when you focus on one element, you are  
 blurring
 another.  Anyone have any suggestions on how to accomplish this or  
 where I
 can go to get some help with this?  Any help would be greatly  
 appreciated.

 Blessings,
 Eric






 



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230713
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread J W
I have a popUp  window that triggers after XXX number of seconds from the
main browser window, works great when the browser window is visable on the
desktop. Pops the new window to the front perfectly. ...BUT if the browser
window is minimized to the task bar before the time elapses, the popup never
shows. How do you make a javascript window.open funtion popup a new window
from a minimized browser???

Thanks,
Jeff


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230031
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread Robert Everland III
This most likely is due to stopping the popup that has been built into the 
browsers. They have stopped popups from opening when there is no action by the 
user to initiate the popup. Companies have found ways around this, which I'm 
sure if you did enough research you could fine it. I would find a different way 
to do the popup, maybe a div that goes over the whole page. Something users 
aren't annoyed about.


Bob

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230033
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread J W
Its actually for a pretty harmless inactivity timeout so the user doesn't
loose session. Basically after the time elapsed, it pops up a screen with a
warning. From that popup they then have a choice of keeping the session
active closing the session or after another minute logs them out of my
system gracefully.

Is there a better way to handle an activity timeout??

Jeff

On 1/19/06, Robert Everland III [EMAIL PROTECTED] wrote:

 This most likely is due to stopping the popup that has been built into the
 browsers. They have stopped popups from opening when there is no action by
 the user to initiate the popup. Companies have found ways around this, which
 I'm sure if you did enough research you could fine it. I would find a
 different way to do the popup, maybe a div that goes over the whole page.
 Something users aren't annoyed about.


 Bob

 

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230035
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread Robert Everland III
I would do an absolute div that when show it self at the highest level once the 
timeout is about to occur. It won't catch a users's eye, but it will have the 
same desired result. Or even a confirm box that pops up to the user. Not as 
pretty but fast and easy to implement.



Bob

~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230037
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread Claude Schneegans
 Its actually for a pretty harmless inactivity timeout so the user doesn't
loose session.

I would use an HTTPrequest to do this. The advantage is that nothing 
shows up on the screen,
and it works even with anti-popups.

Look at XMLHttpRequest, even if no XML is involved.

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230045
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread Bobby Hartsfield
Personally I prefer the hidden divs for a few different reasons as well.
However, that’s not going to solve your problem either. If the window is
minimized, you wouldn’t see that either.

What if you window.focus() first (just before the popup)? What happens then?

Or maybe a window.moveTo(0,0) or window.resizeTo(screen.width,screen.height)
function might bring the parent window back up? Just a couple of things to
try, I havent tried any of them.

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 
 

-Original Message-
From: Robert Everland III [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 2:23 PM
To: CF-Talk
Subject: Re: SOT: Javascript question... Window.open... Weird results.

I would do an absolute div that when show it self at the highest level once
the timeout is about to occur. It won't catch a users's eye, but it will
have the same desired result. Or even a confirm box that pops up to the
user. Not as pretty but fast and easy to implement.



Bob



~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230046
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread Bobby Hartsfield
I was going to mention that too. You could keep the session timeout very low
then keep it alive as long as the browser is open by 'refreshing' it every
minute or so behind the scenes with httprequest. The effect is that the
user's session stays active as long as they are on the page. When they close
the browser, the session times out very quickly.

If you aren't stuck on the idea of alerting the user about the session
coming to an end to give them the option of renewing it or letting it end,
I'd go with Claude's suggestion.
 
..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 
 

-Original Message-
From: Claude Schneegans [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 4:03 PM
To: CF-Talk
Subject: Re: SOT: Javascript question... Window.open... Weird results.

 Its actually for a pretty harmless inactivity timeout so the user doesn't
loose session.

I would use an HTTPrequest to do this. The advantage is that nothing 
shows up on the screen,
and it works even with anti-popups.

Look at XMLHttpRequest, even if no XML is involved.

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230048
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread Claude Schneegans
 If you aren't stuck on the idea of alerting the user about the session

And the less you ask the user about things he doesn't kown about, the 
better will you application work ;-)

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230050
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Re: SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread J W
You know I would agree with you but this particular app it is better to
alert the users...

BTW. window.focus() just before the popup in the original browser window
fixed the issue. Wored in both firefox and IE on windows.

Jeff

On 1/19/06, Claude Schneegans [EMAIL PROTECTED] wrote:

 If you aren't stuck on the idea of alerting the user about the session

 And the less you ask the user about things he doesn't kown about, the
 better will you application work ;-)

 --
 ___
 REUSE CODE! Use custom tags;
 See http://www.contentbox.com/claude/customtags/tagstore.cfm
 (Please send any spam to this address: [EMAIL PROTECTED])
 Thanks.




~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230054
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: SOT: Javascript question... Window.open... Weird results.

2006-01-19 Thread Bobby Hartsfield
 Wored in both firefox and IE on windows.

It's a pretty compatible function. You should be fine in just about any
browser that allows window.open()'s then.
 
 And the less you ask the user about things he doesn't know about, the
 better will your application work ;-)

Carve that in stone somewhere please! ;-)

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 
 

-Original Message-
From: J W [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 19, 2006 4:51 PM
To: CF-Talk
Subject: Re: SOT: Javascript question... Window.open... Weird results.

You know I would agree with you but this particular app it is better to
alert the users...

BTW. window.focus() just before the popup in the original browser window
fixed the issue. Wored in both firefox and IE on windows.

Jeff

On 1/19/06, Claude Schneegans [EMAIL PROTECTED] wrote:

 If you aren't stuck on the idea of alerting the user about the session

 And the less you ask the user about things he doesn't kown about, the
 better will you application work ;-)

 --
 ___
 REUSE CODE! Use custom tags;
 See http://www.contentbox.com/claude/customtags/tagstore.cfm
 (Please send any spam to this address: [EMAIL PROTECTED])
 Thanks.






~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230055
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Javascript question

2005-12-14 Thread Andrew Scott
Very easy actually.


script language=javascript
 Function showSubmit(element)
 {
   Element.style.visibility = show;
 }
/script

input style=visibility:hidden; TYPE=submit VALUE=Submit Order


Another way you could do this is have the button disabled, and then enable
the button once the required action is completed.


Regards,
Andrew Scott
 
Quote of the Day:
Never express yourself more clearly than you think. - N. Bohr
-Original Message-
From: eric.creese [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 14 December 2005 5:05 PM
To: CF-Talk
Subject: Javascript question

Quick qustion, I have a submit button I do not want to show until a user
clicks a button to calculate a total first on the same page. How do I do
this?

tr
  td align=center CLASS=defaulttextbTOTAL:/b/td
  td align=center colspan=2INPUT CLASS=inputlarge TYPE=button
VALUE=Click to Total Order
onClick=order.totaltxt.value=total(this.form);/td
  td align=rightINPUT CLASS=textbox TYPE=text NAME=totaltxt
SIZE=10 MAXLENGTH=30 VALUE=0 
  /td
 /tr
 tr
  td align=center colspan=4
   cfif order.totaltxt NEQ 0
   INPUT CLASS=inputlarge TYPE=submit VALUE=Submit Order
  /cfif
  /td
 /tr



~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226997
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


  1   2   3   4   >