Unable to apply style to div tags inside form

Reply

Join Date: Jun 2009
Posts: 1
Reputation: kharini is an unknown quantity at this point 
Solved Threads: 0
kharini kharini is offline Offline
Newbie Poster

Unable to apply style to div tags inside form

 
0
  #1
Jun 17th, 2009
Hi All,
I hope my problem 'll get solved by posting my query here.
Actually I have div tag with this style.
<style type="text/css">
          .Box {
         display:none;
         }
         .Box1 {
 display:none;
         }
</style>


If i give the div tags directly in the jsp its working fine,,
like this
<s:select label="Occupation Type" id="Workselect" name="background.workType" headerKey="1"  headerValue="--Please Select--" list="#{'S':'Pursuing Education','W':'Working Professional'}" />
         <div  class="Box">
             <s:textfield label="Organization Name" id="ON" name="background.orgName" />
            </div>
            <div  class="Box1">
             <s:textfield id="IN" label="Institute Name" id="Iname" name="background.instName" />
            </div>



but if i wrap it with the form tag its not working.
<s:form action="Register" method="POST" enctype="multipart/form-data">
            <s:select label="Occupation Type" id="Workselect" name="background.workType" headerKey="1"  headerValue="--Please Select--" list="#{'S':'Pursuing Education','W':'Working Professional'}" />
         <div  class="Box">
             <s:textfield label="Organization Name" id="ON" name="background.orgName" />
            </div>
            <div  class="Box1">
             <s:textfield id="IN" label="Institute Name" id="Iname" name="background.instName" />
            </div>
            </s:form>


I donot know how to apply css for divs inside the form tag.
I want to hide the contents of div tag when placed inside the form.
How can i do that?
Appreciate any help

Thanks
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,311
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: Unable to apply style to div tags inside form

 
0
  #2
Jun 17th, 2009
HTML and CSS Syntax (Toggle Plain Text)
  1. <style type="text/css">
  2. .Box { display:none; }
  3. .Box1 { display:none; }
  4. </style>
  5. <s:form action="Register" method="POST" enctype="multipart/form-data">
  6. <s:select label="Occupation Type" id="Workselect" name="background.workType" headerKey="1" headerValue="--Please Select--" list="#{'S':'Pursuing Education','W':'Working Professional'}" />
  7. <s:textfield class="Box" label="Organization Name" id="ON" name="background.orgName" />
  8. <s:textfield class="Box1" id="IN" label="Institute Name" id="Iname" name="background.instName" />
  9. </s:form>

?? the code supplied is not html, check elsewhere than your inline code for other styles defining
<s:
elements,
try the sample code
Last edited by almostbob; Jun 17th, 2009 at 10:58 am.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Unable to apply style to div tags inside form

 
0
  #3
Jun 20th, 2009
If a script is changing the s tags into other tags, the styles will not apply. The styles are applied at the time the page originally renders.

The s tags cause a failure to render anything inside them, because html does not have an s tag. They also throw the browser into quirks mode.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC