Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips

DHTML - Page 2

21-40 of 111     Previous     Next
Alternate Colors Every Other Row in a Table
by DevX Pro
I want to present the results of a search in a table with two background colors, so that every other row will change color. How can I do this?
Replace Selected Content
by DevX Pro
How do I replicate the pasteHTML function supported by Internet Explorer in Netscape? Rewriting the layer isn't the problem. The problem is determining the position of the text returned by the getSelection(). For example, how would I allow a user to select a piece of text on the screen and modify it (i.e. make it bold)? If the selected word appears more than once in the text, I can't just find() it.
Nested Quotes and JavaScript
by DevX Pro
I am trying to use document.writeln to write a table onto a floating menu bar. Part of the table cell's events is Java code. When it reaches the semicolons in the code for the table, it thinks it is the end of the line. How can I pass semicolons in document.writeln so JavaScript knows it's not at the end? document.writeln ('
Set Font Size in Tables Using DHTML
by DevX Pro
In Microsoft Internet Explorer, I can specify a style as TABLE.listTable { font-size : "10pt"} and all the cells of the table will have a 10pt font size. In Netscape, this approach doesn't work because the font sizes have to be specified for each cell (), and any font specification you do at the table level doesn't apply to each cell. Can you suggest a solution so I don't have to specify something like classes.listTable.td.fontSize = "10pt" and add the CLASS=listTable to each ?
Set DIV Clipping Height
by DevX Pro
I am inserting some text into a DIV in Netscape using the .open, write(), and close() methods. At first there is nothing in the DIV, and when I check the clip.height value and .height value, both are 0. Then I insert some text into the DIV and the clip.height value increases to 30, but the .height value remains at 0. The problem is that when I write to the DIV again—this time with a blank string—the clip.height does not reduce; it stays at the higher value. So it is dynamically increasing, but not decreasing.
Place Image in an Absolute Position
by DevX Pro
I've been using the Microsoft ActiveX image control to place my images in absolute positions on my Web page. However, I have run into problems with this image component on some PCs. I have tried to reregister the ISCTRLS.OCX, which contains this component, but this does not help. Can you give me an example on how to place an image in an absolute position without using an explicit ActiveX image component?
Registering DLLs in DHTML Applications
by DevX Pro
I've just started using DHTML in Visual Basic 6.0 and have encountered a few glitches. When using ActiveX DHTML, where does the compiled DLL file have to be stored (filed) so that the HTML file that is subsequently produced can use it? When registering the DLL file produced in a program such as VB 6.0 ActiveX DHTML using Regsvr32.exe, where do you register the DLL file? How can I register the file so that the HTML file can be used over the Internet, or within an intranet?
CSS With Multimedia Elements on Page
by DevX Pro
Is there a way to layer page elements through Cascading Style Sheets (CSS) over an embedded element such as a Shockwave movie? My present page has a sliding graphic which overlays the main splash page's graphic (comprised of JPGs and an animated GIF). I would like to retain the sliding graphic but substitute Shockwave for the 450x280px present underlying graphic.
Designing Custom Components Using Scriptlets
by DevX Pro
Can I design custom components using scriptlets?
Dynamically Create Reports
by DevX Pro
Using Visual Basic 6.0, I created a reference to a HTMLDocument object. I built a basic HTML page template and displayed it within a Web browser control on a form. I've been able to manipulate certain elements on the form by assigning IDs in certain tags. For example, I have been writing data from a SQL Server 7.0 database to display in the HTML page. I am trying to produce a set of dynamic HTML reports to view the data in the database. The problem is that I want to dynamically create elements on another HTML page and not just write data to a template HTML page (using IDs). Because I don't know how many rows will be returned by a recordset, I need to be able to dynamically create the report. For example, there could be 10 rows in a table element or 100. How can I do this using the HTMLDocument object?
DHTML Options Object Generation
by DevX Pro
I tried loading two frames in the browser called "TOP" and "BOTTOM". The "BOTTOM" frame loads a JavaScript file (j1.js) and another two frames in it called "LEFT" and "RIGHT". In the "LEFT" frame, a form called "formA" contains a button "B1" and a select object "S1". Every time you click the "B1" button, it calls the function using this code: "onClick=parent.add_option(S1)" add_option is defined in j1.js as this: function add_options(sel_obj) { var tstr; tstr = sel_obj.length + " th item"; alert (sel_obj.name); sel_obj.options[sel_obj.length] = new Option(tstr, tstr); } This code works fine in Internet Explorer 4 and all versions of Netscape, but I can't get it to work in IE5.
Displaying Items Above ActiveX Controls
by DevX Pro
I am using tags as dropdown menus at the top of my pages. But if I have an ActiveX control below my menu then the dropdown menus' fall drops in behind the control. I have tried to set the z-index but this only works with HTML objects, not with the ActiveX control. Inserting the control in a doesn't work either.
Using Form Elements in DHTML
by DevX Pro
I am having a problem accessing the form elements that are inside a DIV tag. It works in Internet Explorer but not in Netscape. The alert comes in both the browsers, but the next statement does not work in Netscape. Here is my code: Document Title #myCalLayer {POSITION:absolute;VISIBILITY:visible;TOP:200px;LEFT:200px;Z-INDEX:10;} This is in the div tag Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Year
Changing an Image Src in a DIV From Another DIV
by DevX Pro
I can't reach an image src in a DIV from another DIV in Netscape. Do you have any suggestions?
DHTML Loads Faster Than Accompanying HTML
by DevX Pro
I often have the problem in which the DHTML on my page loads faster than the accompanying HTML. Therefore, users are enticed to click away at elements, which trigger events that act on HTML that have not yet loaded. The result is a script error. I know I can trigger a function onload that continuously polls the readystate of the document. While it polls, 'document.onmousedown = null' works in nullifying mouse clicks. But how do I reset document.onmousedown to resume normal operation after the document's readystate is true?
Encountering Tabular Data Control Error
by DevX Pro
I have an index page where the user clicks on a name to bring up that person's biography on the next page. The names are hyperlinks to the next page followed by # and the number of that person's record. I use the Internet Explorer ActiveX Tabular Data Control (TDC) to retrieve the biography info from my Data Source Object (DSO). I use a simple JavaScript to retrieve the number and call the appropriate recordset: var carryString = document.location.hash; carryString = carryString.substring(2, carryString.length); var biosrs = biosTDC.recordset; biosrs.absoluteposition = carryString; Most of the time (but not always) I get the error, "The operation requested by the application is not allowed if the object is closed," when trying to load the TDC page and only the first record. This does not occur while running the page locally (off the hard drive)—only when it is online. How can I eliminate this problem?
Printing a Barcode (GIF) From Netscape 4.05+
by DevX Pro
I have a barcode saved as a GIF that is truncated each time it is printed from Netscape. It prints fine in Internet Explorer and Netscape 4.04 but does not work in subsequent versions of Netscape. The GIF displays properly but is altered when previewed or printed. I have looked at your comments related to printing DHTML and felt that my issue is similar. I was unsure how to print the window created by your JavaScript in this response. I was able to generate the PrintWindow but didn't know what to do next. I have simple HTML and GIF files to demonstrate this problem.
Text Range and pasteHTML
by DevX Pro
I am using an array on the client side to create an HTML string that builds a table of data, which the user can then manipulate. Because the array is on the client side and the user can insert, delete, and change data, I'm using a text range on the body and pasteHTML to render the table to the user. The table and data appear but none of the events tied to the elements are firing. These events are included in the HTML string. I've tried encoding quotes (chr(34)) which ended up making a set of double quotes, no quotes, and a single quote. None of these seem to have any effect. What is odd is that I can do a document.write so that I can see the rendered HTML, copy this to a new page, add in the subs, and the events fire. I've searched everywhere and can't find any topics that would indicate what my problem could be.
VB DHTML Input Field Handling
by DevX Pro
I have a DHTML form that is dynamically generated based on a user's selection from a list box. It generates a table line for product information which includes text fields and an input (order quantity) text box for each item. The number of items varies widely based on the user's selection. How can I (or better yet, can I) access the .value property of these generated input fields in Visual Basic?
"Disable" the Browser's Back Button
by Kurt Cagle
While there is no way to specifically disable the back button from within the browser, you can shortcut the navigation to another page. The trick is to catch the onbeforeunload event of the ...
21-40 of 111     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date