FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Validation problems with <form>

 


rohan2kool
The problem is that I have the username/password fields like this:

Code:

<table>
 <tr>
   <td><input type="text" name="uname"/></td>
 </tr>
 <tr>
   <td><input type="password" name="pword"/></td>
 </tr>
</table>


Now the problem is that, I'm not understanding where to put the <form> tags. As is obvious when i place it in between the <tr> or <td> tags, it gives me validation errors.. please help.

PS: Don't give suggestions like "Don't use tables for layout" and all that.. i've already done a lot too much in my layout to make any changes now. not being rude, just making this easier... Wink

thanks in advance
mariohs
hahaha
you ask, we deliver... i'll post a solution without telling you not to use tables for layout...

i'm not sure, but try to enclosure all the <table> tag with the <form> tag... something like this:

Code:
<form action="">
<table>
... [fields and layout come here]
</table>
</form>


if you are still interested in converting your form to a tableless layout, I would suggest you to take a look at the Awesome Forms, by Paul Armstrong
rohan2kool
hey.. thanks a lot for the link... i'll change atleast the form elements.. anything for validation Wink

as for ur solution, that's also a problem as <form> cannot have the element <table> inside it... (xHMTL 1.0 transitional.. no strict for me)
Esch
Interesting; according to this site, it's just fine for the form tag to contain table tags:

http://webdesign.about.com/od/htmltags/p/bltags_form.htm

I don't know if it'd be possible to do what you want otherwise, because I'm almost certain that table tags can't contain form tags, unless they're inside a td.
rohan2kool
oops.. sorry i goofed up.. it is allowed to include the <table> element within the <form> element.. sorry for the mistake.. problem solved

mods may lock the topic.. Wink
cesarernst
Other Idea
Remove <form><form> an Try
document.GetelementbyID("uname").value
htmlrules
Place the form tags out side the table tags
rohan2kool
cesarernst wrote:
Other Idea
Remove <form><form> an Try
document.GetelementbyID("uname").value


but that'd would cripple non-JS users. something as integral for sites as forms shouldn't be kept away from those less blessed Very Happy
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.