Link to home
Start Free TrialLog in
Avatar of matthew016
matthew016Flag for Belgium

asked on

Invalid location of h5

Hi,
I want to put titles in my form,
but I see an error : Invalid location of h5

Why ? How can I do to add correctly titles in my form ?

Thank u.
Avatar of gamebits
gamebits
Flag of Canada image

Hi matthew016,

Can you post the code and tell me what you want to do exactly.

Gamebits

Cheers!
Avatar of matthew016

ASKER

Hmmm ... the errors have disappeared
matthew016,

h5 is a tag by itself it cannot be inside another tag (like the form tag for instance)

to put a title on your form you could use fieldset

<fieldset><legend><h5>your title</h5></legend>
<form>here you put your form
</form>
</fieldset>

Gamebits
     <html:form  method="post" target="_blank" action="/Chat.do" onsubmit="goIndex();">
            <h5>Age :</h5>

                  <html:text property="age" size="15"/>
                  <html:errors property="age"/>
            <br/>
            <h5>Ville :</h5>

                  <html:text property="city" size="15"/>
                  <html:errors property="city"/>
            <br/>
            <h5>Sexe :</h5>

                  <html:radio value="M" property="gender"/>Masculin
                  <html:radio value="F" property="gender"/>Féminin
                  <html:radio value="I" property="gender"/>Inconnu
                  <html:errors property="gender"/>
            <br/>
            <h5>Salons :</h5>

                  <html:select size="1" property="room">
                        <c:forEach var="aRoom" items="${requestScope.rooms}">
                              <option value="${aRoom}"/>
                              <c:out value="${aRoom}"/>
                        </c:forEach>
                  </html:select>
            <br/>
            <br/>
            <br/>
            <!-- <input name="do" value="chat1" style="display:none" type="text"> -->
            <input value="Se connecter" type="submit"/>
      </html:form>



I have no errors anymore,
are u sure its not allowed ?
Well I don't know what to say because I never use this type of coding

<html:form  

I always used <form

same with

<html:text property="age" size="15"/>

I would have used

<input type="text" name="age" size="15">

May be another expert will be able to help you.

In the mean time you can always validate your mark up with w3c

http://validator.w3.org/

you'll know for sure if it's valid or not.

gamebits
no, just takes this as <form

<html:form gets rendered by <form  in the html for the user.
same thing for the other tags
ASKER CERTIFIED SOLUTION
Avatar of gamebits
gamebits
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the points and the grade.

Gamebits