Connecting Tech Pros Worldwide Help | Site Map

Dynamically create javascript

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 3rd, 2005, 07:55 PM
xxbmichae1@supergambler.com
Guest
 
Posts: n/a
Default Dynamically create javascript

I am writing a function that will create different type of input
ranges, example one function that will create date range inputs with
drop down calendars, another will be for currency ranges, another for
uppercase input, etc.... anyway, the drop down calendar I am using has
a javascript you call after the html of your edit box and object to
click on to drop the calendar....is there a way or is it correct to
say, that if you use innerHtml of the body that it will work, or am I
over complicating things and should just call the javascript function
Calendar.setup() passing all the parameters within the javascript that
creates the controls?? Thanks in advance for any advice and
assistance....

Michael


  #2  
Old November 3rd, 2005, 10:55 PM
RobG
Guest
 
Posts: n/a
Default Re: Dynamically create javascript

xxbmichae1@supergambler.com wrote:[color=blue]
> I am writing a function that will create different type of input
> ranges, example one function that will create date range inputs with
> drop down calendars, another will be for currency ranges, another for
> uppercase input, etc.... anyway, the drop down calendar I am using has
> a javascript you call after the html of your edit box and object to
> click on to drop the calendar....is there a way or is it correct to
> say, that if you use innerHtml of the body that it will work, or am I[/color]

It may 'work', but you might have other criteria - such as efficiency,
maintainability, compatibility, etc. - not satisfied by innerHTML.

[color=blue]
> over complicating things and should just call the javascript function
> Calendar.setup() passing all the parameters within the javascript that
> creates the controls?? Thanks in advance for any advice and[/color]

Without knowing your requirements in any detail, it's hard to say what
is best. Presumably a user will select some option or enter some data,
and based on that you will calculate a range. You will then either
build some option lists, or modify some existing lists, that offer
values within the calculated range.

Search through this group for 'dynamic option list'.

In general, manipulation of HTML elements should be done using the DOM,
not innerHTML. There are plenty of quirks when using DOM, and variances
between browsers, but overall it is 'better' than innerHTML.

You may get better responses if you use reasonable punctuation and
formatting. The quality of responses is usually directly proportional
to the effort put into posting.



--
Rob
  #3  
Old November 5th, 2005, 09:25 PM
xxbmichae1@supergambler.com
Guest
 
Posts: n/a
Default Re: Dynamically create javascript

Thanks for your response Rob,

I'm finding that using DOM is much more reliable than innerHtml.....I
realized after my post, I was being really stupid....all I need to do
is call the setup function of the calendar object passing in the newly
created controls....thanks for your time.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.