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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

netscape forms in divs

Status
Not open for further replies.

crystalized

Programmer
Jul 10, 2000
390
CA
I know that I have just recently read that Netscape interprets each individual div as a seperate document so that there are problems with using form elements in different div's than where the form tags are.

I am using ASP and Interdev that puts the form tags around the whole page basically, but my form elements are inside of a particular div.

Can anyone give me a quick rundown on how to conquer this problem. Or tell me where I read that since I simply can not remember (is anyone psychic out there). X-)

[sig]<p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
[/sig]
 
Well this is the solution I arrived at although I know it is not perfect it will suffice for now.

Code:
function browserCheck()
		
		'use a server object to check the browser
		dim currBrowser
		dim correctType
		correctType=false
		
		set currBrowser=Server.CreateObject(&quot;MSWC.BrowserType&quot;)
		'test the browser
		if currBrowser.browser=&quot;IE&quot; then
			correctType=true
		else
			correctType=false
		end if
		
		'return the status
		browserCheck=correctType
		
	end function
.
.
.
<div ID=&quot;contentDiv&quot;>
<% if not browserCheck() then 
	notifyError(&quot;To access the data entry forms you must be using Internet Explorer&quot;)
%>
	<form>
<% end if %>
:
:
<% if not browserCheck() then %>
	</form>
<% end if %>
</div>
notifyError just prints out a message on the page.

This allows me to put my form elements into a div tag and show the form fields. I suppose I could also just not show the form when it is netscape but where would the fun be in that. I am lucky that the data entry part of the web is for members only and that I am allowed to impose the IE restriction.

And I found the reference I knew I had read. It has one small example of doing the form inside a div at

[sig]<p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
[/sig]
 
As an addendum to what I last posted I would like to point out that the form does not work properly using this. Basically it allows the user to see the form elements. For this particular thing I did not really need the form to work since I was restricting users to IE.


Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top