CSS - Javascript To Display Form Output To Particular Css Div?
Hi, I have a webpage with a 3 column layout using css. In the left column I have a form which takes input and relays it to another php script which either populates another form or produces output.
I would like to control where the output of each form is displayed. With frames I just use the target command. Some of the output will be in the same div as the original form (if the output is a form) or in the middle column if it is an output of results. I have been told that javascript would accomplish this. Any thoughts? Thanks, R Haynes Similar TutorialsHi all, I'm implementing a web form where the labels for each input will appear as the default value rather than having the actual label elements visible. The label elements themselves will still be present in the markup for accessibility. I want to visually remove the labels while still having them acknowledged by screen readers. I'm aware of the left-offset trick, but I've read several articles where it's suggested to simple set the labels to display: none with JavaScript after the DOM has loaded. This seems to assume that screen readers will ignore this, otherwise there you might as well just set them as display: none in the first place. Can anyone confirm that a screen reader will still acknowledge a label element if display: none has only been applied after the DOM load via JavaScript? Thanks! Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color:#060606; background:url(images/background.png) repeat-y left top; } ul, ul li { margin:0; padding:0; list-style:none; } ol, ol li { margin:0; padding:0; list-style:none; } div { margin:0; padding:0; } .clear { clear:both; } .wrapper { width:100%; height:1000px; border:1px solid #FF0000; } .header_wrapper { background:url(images/banner_bg.png) no-repeat left top; height:115px; width:100%; border-bottom:2px solid #FCE66F; } .header_wrapper .header { width:906px; height:115px; margin:0 auto; outline:1px solid #0000FF; } .header_wrapper .header .logo { float:left; left:0; top:0; width:136px; } .header_wrapper .header .title { float:left; margin-left:10px; padding-top:42px; width:491px; } .header_wrapper .header .right { width:245px; height:115px; float:right; outline:1px solid #0000FF; position:relative; } .header_wrapper .header .right .link { font:Tahoma, "Times New Roman", "Trebuchet MS", Verdana, Georgia, Arial, sans-serif; color:#F4E8D1; padding-top:28px; width:145px; height:20px; outline:1px solid #0033FF; position:absolute; right:0; } .header_wrapper .header .right .search { width:245px; height:35px; outline:1px solid #FF0000; position:absolute; bottom:20px; right:0; } .header_wrapper .header .right .link ul li a { line-height:10px; border-left:1px solid #F4E8D1; float:left; text-decoration:none; margin-left:15px; padding-left:15px; color:#F4E8D1; } .header_wrapper .header .right .link ul li.first a { border:none; } .header_wrapper .header .right .link ul li a:hover { text-decoration:underline; } .container_wrapper { width:923px; margin:0 auto; background:#060606; outline:1px solid #FF0000; } .container_wrapper .nav { margin:0 auto; padding-top:30px; width:923px; height:32px; font:12px Tahoma, "Times New Roman", "Trebuchet MS", Verdana, Georgia, Arial, sans-serif; } .container_wrapper .nav ul { list-style:none; margin:0; padding:0; } .container_wrapper .nav ul li { display:inline; margin-top:27px; } .container_wrapper .nav ul li a { padding:17px 35px; color:#FF6600; text-decoration:none; } .container_wrapper .nav ul li.first a { margin-left:30px; } .container_wrapper .nav ul li a:hover { background:url(images/hover_button1.png) center center no-repeat; color:#FF6600; } .container_wrapper .home_container { margin:0 auto; width:906px; outline:1px solid #0000FF; position:relative; } .container_wrapper .home_container .container_bg { background:url(images/body_bg.png) repeat-y left top; } .container_wrapper .home_container .left { float:left; width:219px; outline:1px solid #0000FF; margin-left:10px; } .container_wrapper .home_container .left .background { background:url(images/left_box_bg_img.png) repeat-y left top; } .container_wrapper .home_container .left .background .title { font: bold 12px Verdana, Arial, Helvetica, sans-serif; color:#FDFD31; width:190px; border-bottom:2px solid #FF7811; margin-left:12px; padding-bottom:5px; padding-left:2px; } .container_wrapper .home_container .left .background .pruduct { width:190px; margin-left:12px; margin-top:5px; } .container_wrapper .home_container .left .background .pruduct ul li { font:12px Verdana, Arial, Helvetica, sans-serif; color:#FFF500; padding-bottom:5px; } .container_wrapper .home_container .left .background .pruduct ul li a { color:#FFF500; text-decoration:none; } .container_wrapper .home_container .left .background .pruduct ul li a:hover { color:#FFF500; text-decoration:underline; } .container_wrapper .home_container .contain_box { float:left; width:400px; margin:0px 10px 0 10px; } .container_wrapper .home_container .contain_box .contain_title { font:bold 14px Verdana, Arial, Helvetica, sans-serif; color: #FDFD31; padding:5px 0 8px 0; } .container_wrapper .home_container .contain_box .text { font:12px Verdana, Arial, Helvetica, sans-serif; color:#ffffff; font-style:normal; text-align:justify; } .container_wrapper .home_container .right { float:right; width:253px; outline:1px solid #0000FF; } .container_wrapper .home_container .right .right_box_bg { background:url(images/right_box_bg_img.png) repeat-y left top; } .container_wrapper .home_container .right .right_box_bg .daily_news { width:195px; height:120px; outline:1px solid #00FF00; margin:0 auto; padding:0; } .container_wrapper .home_container .right .right_box_bg .daily_news .News_title { font: bold 24px "Times New Roman", Times, serif; color:#000000; text-align:center; border-bottom:2px solid #FA7815; } .container_wrapper .home_container .right .right_box_bg .daily_news .news_scroll { font:12px Verdana, Arial, Helvetica, sans-serif; text-align:center; width:175px; padding-left:20px; } .container_wrapper .home_container .right .right_box_bg .login_nox { width:230px; height:200px; outline:1px solid #0000FF; margin:0 auto; margin-top:20px; } .footer { margin:0 auto; width:906px; height:73px; background:url(images/footer2.png) no-repeat; margin-top:5px; outline:1px solid #0000FF; text-align:center; } .footer ul li { font:12px "Times New Roman", Times, serif; color:#C1A579; display:inline; line-height:80px; margin-left:20px; padding-left:20px; } .footer ul li a { font:12px "Times New Roman", Times, serif; color:#C1A579; text-decoration:none; } .footer ul li a:hover { text-decoration:underline; } </style> </head> <body> <div class="wrapper"> <div class="header_wrapper"> <div class="header"> <div class="logo"><img src="images/logo.png" height="171" width="136"/></div> <div class="title"> <img src="images/banner_title.png" width="500" height="56" /></div> <div class="right"> <div class="link"> <ul> <li class="first"><a href="">Register</a></li> <li><a href="">Login</a></li> </ul> </div> <div class="search"> <table width="245"> <tr> <td><img src="images/search_bg.png" width="179" height="27" /></td><td> <img src="images/go_button.png" width="49" height="29" /></td> </tr> </table> </div> <div class="clear"><!-- --></div> </div> <div class="clear"><!-- --></div> </div> </div> <div class="container_wrapper"> <div class="nav"> <ul> <li class="first"><a href="#">Home </a></li> <li><a href="#">Voluntee </a></li> <li><a href="#">About Us </a></li> <li><a href="#">Events</a></li> <li><a href="#"> Donate </a></li> <li ><a href="#"> Carrier with us</a></li> </ul> </div> <div class="clear"><!-- --></div> <div class="home_container"> <div><img src="images/body_top.png" width="906" height="12"></div> <div class="container_bg"> <div class="left"> <div><img src="images/left_box_top_img.png" width="219" height="14" /></div> <div class="background"> <div class="title">EVENTS</div> <div class="pruduct"> <ul> <li>* <a href="#">Whatexpect on Sundays</a></li> <li>* <a href="#">Location and directions</a></li> <li>* <a href="#">Where to go to wear</a></li> <li>* <a href="#">What for your child</a></li> <li>* <a href="#">Meet the staff</a></li> <li>* <a href="#">ExploreFaith.org</a></li> <li>* <a href="#">Mission Opportunities</a></li> </ul> </div> </div> <div><img src="images/left_box_bottom_img.png" width="219" height="15" /></div> </div> <div class="contain_box"> <div class="contain_title">Welcome to Elite Brigade</div> <div class="text"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br> <br> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </div> </div> <div class="right"> <div> <img src="images/right_box_top_img.png" width="253" height="18" /></div> <div class="right_box_bg"> <div class="daily_news"> <div class="News_title">Daily News</div> <div class="news_scroll"> <marquee height="80" behavior="scroll" direction="up" scrolldelay="50" truespeed="truespeed" scrollamount="1" onmouseover="this.stop()" onmouseout="this.start()" > Put Your Images tag here </marquee> </div> </div> <div class="login_nox"></div> </div> <div><img src="images/right_box_bottom_img.png" width="253" height="17" /></div> </div> <div class="clear"><!-- --></div> </div> <div><img src="images/body_bottom_.png" width="906" height="23"/></div> </div> <div class="clear"><!-- --></div> <div class="footer"> <ul> <li><a href="#">About Us</a></li> <li><a href="#">Contact us</a></li> <li><a href="#">Privacy Policy</a></li> <li><a href="#">Copyright statement</a></li> </ul> </div> </div> </div> </div> </body> </html> Quote: Hi Friends........... Above code is an home page of website and I want that when user clicks on register link, the registration form(PHP File) displays below "Welcome to Ankit" by replacing "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br> <br> <span style="font-weight: bold">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."</span> instead of another page. Anyone plz help me?????????????? Thx in advance............ Hi, I am redesigning my site using CSS. My site consists of various forms for which I currently direct output to specific frames. Now I am tossing the frames and using css with div's. I have a two column layout with various search features and drop-down menus in the left div. I would like to have the output from the form placed in the right div. Currently I do this with a target="" in my form call. What is the easiest way to do this with css and div's. Any pointers would be greatly appreciated. R Haynes Is there a way to change the value of the display property using CSS rather than JavaScript on the client side? [edit] New question, see http://forums.devshed.com/css-help-...tml#post1377956 below for details. Thanks! --------- old question ------------ Hi, I'm trying to get some checkboxes aligned in a form that i'm creating. I can get it to work perfectly in Firefox, but not in IE6. In Firefox: In IE6: I don't care so much about the height/spacing issue as much as the left/right reversal. the relevant css(i think) is here Code: #application p {text-indent: 0px;} #application div.col1 {width: 50%; float: left;} #application div.col2 {width: 50%; float: right;} #application label { float: left; width: 70px; text-align: right; height: 2em; line-height: 2em; } #application .label_checkbox {width: 100%;} #application .label_checkbox p{ clear: both; float: none; position: relative; } #application .label_checkbox input { position: absolute; top: 1px; left: 1px; } #application .label_checkbox label { display: block; margin-left: 22px; text-align: left; width: 160px; } and relevant xhtml: Code: <div class="label_checkbox"> <div class="col1"> <p><input type="checkbox" id="ch" value="Classroom Helper" name="roles" /><label for="ch">Classroom Helpers</label></p> <p><input type="checkbox" id="lt" value="Literacy Tutor" name="roles" /><label for="lt">Literacy Tutor</label></p> <p><input type="checkbox" id="ta" value="Technology Assistant" name="roles" /><label for="ta">Technology Assistant</label></p> <p><input type="checkbox" id="ce" value="Campus Enrichment" name="roles" /><label for="ce">Campus Enrichment</label></p> <p><input type="checkbox" id="ote" value="One-Time Events" name="roles" /><label for="ote">One-Time Events</label></p> </div> <div class="col2"> <p><input type="checkbox" id="frn" value="Family Reading Night" name="roles" /><label for="frn">Family Reading Night</label></p> <p><input type="checkbox" id="rad" value="Read Aloud Day" name="roles" /><label for="rad">Read Aloud Day</label></p> <p><input type="checkbox" id="dd" value="Dictionary Day" name="roles" /><label for="dd">Dictionary Day</label></p> <p><input type="checkbox" id="gs" value="Guest Speaker" name="roles" /><label for="gs">Guest Speaker</label></p> <p><input type="checkbox" id="other" value="Other" name="roles" /><label for="other">Other</label></p> </div> </div> you can see the page at http://oaklandheroes.org/beta/application.php. Thanks for the help! Hi, If I place an input field or select box in a div and set the display to none - will that variable still be sent when the form is submitted? Thanks, Hi Their.. I have an html page that contains a form named form1...i want to display another form when the button in form1 have submitted....It's a matter of (show/hide) html elements...Anyone can help..please. Thank you in Advance I recently relaunched our web site and, trying to stay with the times, use CSS as much as possible for layout purposes. The one place I still use a table for layout is in the top navigation bar, which includes a search form. I would like to eliminate the table and use CSS for styling the top navigation bar, but am not sure how. I want the pages to hold up in IE 5.0+, Mozilla, Netscape 6+, Firefox and Safari and to be tolerable in Mac IE 5.x - a tall order but manageable I think. Can this be done? Am I stuck with a layout table here? Any help is appreciated. You can see an example web page at: http://www.cambridgema.gov/~CDD/ The HTML is in the attached file. Hello! I've got a <div> inside a <form> which I show/hide when a user clicks on a show/hide link. That div holds several form options which I DON'T want to submit with the form when the div is hidden. At the moment, even when my div is hidden, the values within it are still being submitted with the form. Is it possible to / how do I - hide the div so any values enclosed in it do NOT get submitted along with the form? Thanks, regan. good day, long title, i know this problem is very tricky and i have spent much too long on it, so i decided to ask it here. i have a site that is currently live, and in need of a great css artist to check out a bug for me. i have tested in firefox, ie 7 and safari, and all work fine, but in IE 6, when i use jscript to hide and show a <div></div>, for some reason, half a DIFFERENT <div></div> disappears, and turns into the bg-color. it's very peculiar since the <div></div> tag which gets messed up is seemingly unrelated if anyone has any quick recommendations, then i'd appreciate it, otherwise let me know and i can pm the login and pass to someone to check it out (i dont wanna post it on here since it im trying to keep the project under wraps right now) regards onassar Hi all, I have a fairly complex page with quite a few nested divs, and some of these nested divs have overflow:auto assigned to them. The problem Im having is that on pageload and when I click a link that has uses javascript to switch the visibility of some of the sub elements, it flickers the div to a different part of the page. I know the description isnt much help, but I didnt know if this was something that others had ran into in general with gecko browsers. I've tried assigning overflow: auto to the containing divs, and to no avail. Anyone have any general ideas as to what it could be? Thanks in advance Hi Guys, I'm building some forms, and when they are submitted, I'd like to integrate a method that will fade out the screen a bit, and show an animated "processing" .gif. Basically when the "submit" button is pressed, the form is being submitted to it's destination. The page will hang on the form until the next page is ready to load. While it's hanging there after submitting, I'd like the screen to fade out, and display an image in the center of the screen. I'm hoping this can be achieved with CSS, as I try to use as little Javascript as possible. What's the best way to achieve this? I figure if anything a javascript "onsubmit" function will be a good start. Can the screen be faded with CSS? Is something like this possible, if yes, what's the correct format? input, textarea, button, select { font-size: 8pt; font-weight: bold; onfocus="this.style.background='#DDDDDD'"; onblur="this.style.background='#EFEFEF'"; color: #000000; background-color: #EFEFEF; border: 1px solid #CCCCCC; font-family: Tahoma, arial, helvetica, serif; } I've been seeing people using ul and li tags to make their menus in css. So I've started trying to do the same, here is an example. But obviously here, the buttons are not displaying inline. All of the styles are within the page code itself. I've got a display: inline style on the li tag, but it's still not working? How can I get this to work or is there any other way to get a ul li menu to display this way? Could someone enlighten me why the page in the following URL functions perfectly in both IE6 and FF and yet, I seem to be totally unable to get the darn thing working locally? I am trying to avoid JavaScript and this looked like a very clean way of hiding and revealing menu items. I don't speak Japanese so I don't understand the text on the page either. http://www.amy.hi-ho.ne.jp/staka/hp/dhtm/s_disp.htm Hi! Is is vicious to display a table as "display: block" to force margin-collapsing? Otherwise there's no margin collapsing with other elements. Thanks Hi, I am playing with converting my webpage from frames to css with divs. In my current page I have a form in the left frame which passes info to php file. I have this php file rendered in the right frame, I do this using targets. How do I accomplish this with css? Thanks, R Haynes I'm not looking for an easy way out here. I'm genuinely trying to learn. I understand each browser has it's own way of representing CSS, it's own bugs and quirks etc. But what is it in the code that makes this layout display so differently in each browser? The way im going for is how it shows in IExplorer. In the Firefox version, its left aligned and the margins around the login box are non existent. So if not using text-align:right to get the login box to the right, how else? XHTML 1.1 and CSS both validate correctly. Mozilla Firefox -------------- Internet Explorer -------------- CSS: Code: body { background-color: #a0a0a0; background-image: url(images/index/pageBackground.gif); background-position: top; background-repeat: repeat-x; margin-top: 17px; text-align: center; color: #FFFFFF; } #wrapper { width: 779px; background-color: #323333; color: #FFFFFF; text-align: center; } #topPanel { background-image: url(images/index/headerBG.gif); background-color: #323333; color: #FFFFFF; width: 779px; height: 88px; font: 8pt Verdana, Arial, Helvetica, sans-serif; font-weight: bold; text-align: right; } #login { width: 205px; margin-top: 12px; margin-right: 7px; text-align: right; } #mainContent { background-color: #323333; color: #FFFFFF; width: 779px; font: 10pt Verdana, Arial, Helvetica, sans-serif; }.textBox { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #FFFFFF; background-color: #FFFFEE; border: 1px solid #000000; width: 100px; } ----------------- HTML: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11-flat.dtd"> <html> <head> <title>Bleh</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="rules.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <div id="topPanel"> <form> <div id="login"> Username:<input type="text" id="user" class="textBox"><br /> Password:<input type="password" id="pass" class="textBox"><br /> <input type="image" src="images/index/loginSubmit.gif"> </div> </form> </div> <div id="mainContent"> Testing </div> </div> </body> </html> -------------- Hi..am a real newbie..so plz don't be too harsh on me I have written an online declaration to be 'signed' by the user. The result is a web page which I want the user to print from their browser (like a certificate). What I want to know is: I have a backgroung jpg on the page and I want it to be printed out on A4 paper covering the WHOLE page (no margins or white spaces around the jpg). Just the jpg as the background with the table data in the middle (so it looks like a certificate). Is this possible? Or will I have to create a pdf or doc file so users can download their 'signed' certificate and print from there?? Any help/tips/advice will be greatly appreciated TIA Hi, First, I'm using the javascript/tutorial from http://www.htmldog.com/articles/suckerfish/dropdowns/ Visit http://serve5.net/xcage/nav/ . The spacing inbetween each image is fine, it's how I want it to be. However, view it in Mozilla first then in IE. Notice something? In Mozilla it does what it's supposed to correctly - have the 'main' background turn blue, and the sub-menu background turn green. However, in IE, this makes BOTH the 'main' and sub-menu background green, instead of keeping the main one blue. I have tried for the past 15 minutes trying to figure this out, but came up empty. I believe it's a problem in the javascript hover code, located in sfhover.js.... since that's what controls IE's hover and it works fine in Mozilla Could you look at the code and tell me whats wrong? http://serve5.net/xcage/nav/ http://serve5.net/xcage/nav/styles/xcage.css http://serve5.net/xcage/nav/scripts/sfhover.js Thanks. |