Dynamically create javascript

X

xxbmichae1

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
 
R

RobG

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.
 
X

xxbmichae1

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top