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!

HTML forms

Status
Not open for further replies.

iandobrien

Programmer
May 2, 2002
7
IE
Ok, here's my problem. At the moment i'm writing a HTML form. A person fills out the form and then submits the details with a 'submit' button on the
bottom of the screen. Then, using PHP the details that the person has entered are used to create a completed copy of the form which the person can
then print out. In other words when the person presses submit a new page is generated that, using a javascript function, contains a completed copy of
the form. My problem lies with how i present this info in the form. When a person enters information on the first page its all very straight forward.
For instance, to enter his/her name i use the following line of code (i've created the form using tables)

<td><input type = &quot;text&quot; name=&quot;persons_name&quot; value = &quot;<?php echo $persons_name ?>&quot; size=&quot;43&quot;></td>

All very straight forward (if someones reading this and asking where did u get the &quot;<?php echo $persons_name ?>&quot; thats not important to the problem so
don't worry about it)

As you can see a little text box is created that the person fills their name into. The problem is when i want to then reproduce that on the completed
form ie. display the persons name, it doesn't quite work. Again i use

<td><input type = &quot;text&quot; name=&quot;persons_name&quot; value = &quot;<?php echo $persons_name ?>&quot; size=&quot;43&quot;></td>

to display the name and this works fine in Internet Explorer. The problem is with Netscape. It doesn't display the persons name because i'm using 'input
type = &quot;text&quot;'. So what i want to know is how do i as such create an 'output' text box that will hold my information. Before everyone starts replying,
just use a textarea, that isn't what i'm looking for. All i need is a little box (with NO scrollbar or anything) that will hold the persons name. Sounds
nice and easy but i can't seem to find an answer. Can anyone help??please!thanks,
Ian
 
Code:
<td><input type=&quot;text&quot; name=&quot;persons_name&quot; value=&quot;<?php echo $persons_name ?>&quot; size=&quot;43&quot;></td>

type = &quot;text&quot;
should be
type=&quot;text&quot;

---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
That still doesn't make any difference, any other suggestions Neversleep??thanks,
Ian
 
may i see all the <table> code
its a VERY habit to declare colspan in the <td>
---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
Neversleep, here is the code for the table (its only a snippet of the whole table but its ALL the code relevant to this query)

<table border=0 cellspacing=&quot;0&quot; bordercolor=&quot;WHITE&quot; bgcolor=&quot;#FFFFFF&quot; align=&quot;center&quot;>

<tr><td><input type=&quot;text&quot; name=&quot;persons_name&quot; value=&quot;<?php echo $persons_name ?>&quot; size=&quot;43&quot;></td>
</tr></table>

Thanks!,
Ian
 
iandobrien:

there is no reason why what you have above should not work in NS unless it is the &quot;_&quot; in the name of the input. I know that netscpae wont accpet id's with _ in them so it may be the same for form element names. Try an alternative intercaps notation like this:

name=&quot;personsName&quot;

alternatively you could just output to the <td> and give this a border using css like this. apply a class to the td

<td class=&quot;output&quot;>

and then in your stylesheet like this:

.output{border-width:1px; border-style:solid; border-color:#ff0000;}

I wouldnt reccomend using inline styles as NS4 often chokes on these so its best to use classes.


Neversleep:

Twice now i have seen you reccomend putting colspan attribute on all td's even if it has a value of 1. Why? This is something i have never seen done, never found necessary, and seriously doubt wether it would help in any way.

Infact IMO it can only help to bloat your code increasing download time for your users and increased obfuscation for yourself and others who may havwe to modify your code.

Can you show me any proof of the benefit of this technique?


Good luck with the forms iandobrien, hope this is of help

rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top