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

Inside DIV tag, text box doesn't appear on NS.

Status
Not open for further replies.

martindavey

Programmer
Jan 2, 2000
122
GB
The following short example works on IE, but on NS the input text field doesn't appear??????

<html>

<head>
<style type=&quot;text/css&quot;>
</style>
</head>

<body>

<form>
<div id=&quot;firstname&quot; style=&quot;position:absolute; top:180px; left:25px; z-index:0;&quot;>
<table border=&quot;1&quot;>
<tr>
<td>
First Name<input type=&quot;text&quot;>
</td>
</tr>
</table>
</div>
</form>

</body>
</html>
 
Did you post this one to the JavaScript forum as well? Just in case, here's what I wrote to that question. DIVs don't behave in the expected way when used in NS, instead you're supposed to use the <layer> tag, which doesn't work in older versions of NS and is not recognised at all in IE. So here's what you do...

<layer>
<!--open a layer tag for NS but will be ignored by IE-->
<nolayer>
<!--for versions of NS that don't support-->
<div>
</nolayer>

<!--put your content here-->

<nolayer>
</div>
</nolayer>
</layer>

So as the <nolayer> tag hides the <div> tag from recent versions of NS, it should work in NS, but also, as the <layer> tags are ignored by IE, it should work in IE.

Hope it helps...
 
After some experimenting my problem is this:-

- I have a form, on it are many input fields.
- The form is broken into 3 sections.
- Each section is a separate DIV or LAYER.

The trouble is, within a layer, the input field MUST be within FORM tags, so I end up with, for eg.

<FORM name=&quot;MyForm&quot;>

<LAYER name=&quot;Personal Details&quot;>
<FORM>
First Name<INPUT TYPE=&quot;text&quot; name=&quot;firstname&quot;>
</FORM>
</LAYER>

<LAYER name=&quot;Account Details&quot;>
<FORM>
Account No.<INPUT TYPE=&quot;text&quot; name=&quot;accountno&quot;>
</FORM>
</LAYER>

</FORM>

The problem with this is:-
- The submit button for MyForm cannot follow the other FORM tags and go at the bottom where I want it.
- I can't reference the firstname and accountno fields after submitting the form.

These are my findings - HOW do I get round this????

Feeling desperate - Martin.
 
No wonder your solution doesn't work - the <form> tag immediately preceding the input element doesn't have action property. Over all, you pointed out an important glitch in NN, which I also have encountered before. The glitch is that each form must lie completely within one layer (or within one div) to be considered a single form.

Frankly, I don't see an obvious solution to your problem apart from this bulky work-around: in the layer that contains the submit button you'll have to make hidden copies of the elements from all other layers and on submit you'll have to call a JavaScript function that populates the hidden values from other layers/forms with the values.

Here is a sample:

Code:
<div id=&quot;lay1&quot;>
<form name=&quot;form1&quot; action=&quot;yourScript.cgi&quot;>
<input type=&quot;text&quot; name=&quot;firstname&quot;>
</form>
</div>
<div id=&quot;lay2&quot;>
<form name=&quot;form2&quot; action=&quot;yourScript.cgi&quot;>
<input type=&quot;text&quot; name=&quot;acctname&quot;>
</form>
</div>
<div id=&quot;lay2&quot;>
<form name=&quot;form3&quot; action=&quot;yourScript.cgi&quot;>
<input type=&quot;button&quot; name=&quot;go!&quot; onclick=&quot;mySubmit()&quot;>
<input type=&quot;hidden&quot; name=&quot;firstname&quot;>
<input type=&quot;hidden&quot; name=&quot;accntname&quot;>
</form>
</div>[code]

and in the <head>
[code]<script>
function mySubmit()
{
 document.form3.accntname.value = document.form2.accntname.value;
 document.form3.firstname.value = document.form1.firstname.value;
 return document.form3.submit();
}
</script>
[code]

Let me know if it was helpful. ---
[URL unfurl="true"]http://www.geocities.com/rydel23/[/URL]
---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top