473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Nov 3 '05 #1
2 1741
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
Hi, we have the following problem: in our application v1.0 we have static html pages (+ some javascript). With a CMS (a Content Management System) some "mortal" people can add or expand the...
4
by: Jake Lewis | last post by:
I have an HTML page that loads fine including the .js file <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script...
4
by: cjm | last post by:
I have two problems that I suspect will be bread-and-butter problems for the more experienced guys on here, but I'm not the greatest with js. NB: Code snippets at the bottom The first problem...
5
by: john_williams_800 | last post by:
Hi; I am just starting to use the DOM to do some more advanced javascripting so please be patient with my question if it is an ignorant question. I would like to use the DOM to dynamically...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
5
by: Mike Dee | last post by:
Is it possible to dynamically create a new form object (form1), then create a new form field object and add it form1, and then add form1 to the current document? I need to do all this in script...
4
by: max | last post by:
Hello, Based on various posts, I've come up with the following code to load data into a js array dynamically without a screen refresh. It works, but you have to push the button twice before it...
2
by: A.Wussow | last post by:
Hi Everybody, i want to load dynamically content from some user controls (with forms, or some data-controls) using atlas. So i use an UpdatePanel for loading the user control into a placeholder....
2
by: jmarendo | last post by:
Hello, After reading through the "Table Basics - DOM - Refer to table cells" example at mredkj.com , I modified the code for my own purposes. In the modified version, I create a hyperlink and...
4
by: Lewis Holmes | last post by:
Hi I have the following situation in one of my asp.net pages. The user can add multiple table rows to a form by selecting a button. These rows can contain asp.net controls. When this button is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.