Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I set a SPAN tag ID using NN4? 1

Status
Not open for further replies.

survivorjoe

Technical User
Dec 6, 2000
26
0
0
US
Greetings,

I have some text in a content-managed HTML file using TeamSite, where I want to set values such as Assets Under Management and as-of dates dynamically, using a database table. This HTML page is called by a JSP container page using Weblogic tags. The JSP container page makes the database calls and passes the needed values to form variables using javascript. The form values get to the html page by using SPAN tags. Here is an example of text in the HTML page: "Supported by a professional staff of more than <span id="emp">&nbsp;</span>."

Here is how I am getting the actual number to appear instead of the "emp" SPAN tag:

I have a Weblogic variable - <%= ggemp %> in the JSP page. I have a dummy form tag on the page set:
<form name="form1">
<input type="hidden" name="profemp" value="<%=ggemp %>">
</form>


I have a javascript function in the JSP page that sets the "emp" value:
function setValues() {
document.getElementById("emp").innerHTML = document.form1.profemp.value;
}


You may ask why I just don't stick the <%= ggemp %> tag in place of the span id="emp">&nbsp;</span> tag. This is becuase the text is in a separate HTML file that is generated using TeamSite, and called using Weblogic commands in the JSP page. If the <%= ggemp %> tag were imbedded in the JSP page, the value could be set directly. However, since it is in a separate html page that is getting included into the JSP page, this method does not work. The above form/javascript method does work, but only for IE 6 and Netscape 6+. The 'getElementById' function is not supported on the earlier browsers. Our site has to support IE and NN down to version 4.0.

How do I pass the <%=ggemp%> and other parameters to the HTML page in the other browsers?
 

For NN4, AFAIK, you will have to wrap the SPAN in a LAYER, and dyncamically update the contents of the LAYER.

Either that, or wrap the LAYER in the SPAN. Either way should work.

Hope this helps,
Dan
 
Hey Dan,

How would I do the wrap? Would this wrap cause confusion to the IE6 and NN6+ browsers? I can not create separate versions of the HTML text containing the <SPAN> tags, but I can use browser-specific .js files to process the <SPAN> tags.

Thanks for your help.

- Joe
 

It is possible that LAYER tags may cause problems with other browsers (and would certainly stop pages from validating, anyway).

You might want to use JS to dynamically write out the content... But to do so, you will have to write out ALL the content - otherwise you have a catch 22 - how do you write out only certain content without having a LAYER to write it into?

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top