By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,841 Members | 840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,841 IT Pros & Developers. It's quick & easy.

Dynamically create javascript

P: n/a
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

Nov 3 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
xx********@supergambler.com wrote:
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
It may 'work', but you might have other criteria - such as efficiency,
maintainability, compatibility, etc. - not satisfied by innerHTML.

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


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
Nov 3 '05 #2

P: n/a
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.

Nov 5 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.