Ive redone some of the code and tried this, but my print function doesn't work. If it got working would this only print the div id example?
<div id='example'>
<h3>Saturday Sept. 8th</h3>
</p><strong>7:00AM-8:00AM</strong> </p>
<input type="radio" name= "one" /><label> meditation meeting</label>
<br>
<input type="radio" name= "one" <label> step 1 workshop</label>
<br>
<input type="radio" name= "one"<label > Bottom lines</label>
<br>
<input type="radio" name= "one"<label > Top Lines</label>
<br>
<input type="radio" name= "one"<label> Sponsorship</label>
<br>
<input type="radio" name= "one"<label> Being a Sponsee</label>
<br>
<br>
</p> <strong>8:15AM-9:15AM</strong></p>
<input type="radio" name= "two"<label> Step 2 workshop</label>
<br>
<input type="radio" name= "two"<label>Living life</label>
<br>
<input type="radio" name= "two"<label> chairing a meeting</label>
<br>
<input type="radio" name= "two"<label>Service work</label>
<br>
<input type="radio" name= "two"<label> Accepting gifts</label>
<br>
<input type="radio" name= "two"<label>Principles before Personalities</label>
<br>
<input type="button" value="Print" onclick="printPage('example');"></input>
</div>
You can't control printing in the web browser because that's a user-end functionality, so a workaround/hackie way is required, what I usually do is the following:
You can make a di that will appear in the middle of the screen covering everything behind it using the z-index property
And then fill it with desired content to be printed
And then Right-click==>Print
And then on the printing dialog you can resize the printed content as needed.
Related
Below is my code, I am not understanding why the text is shown to the left.
<label for="dfg" id="OS">
On which OS device do you play? <br>
</label>
<input type="radio" name="OS" id="Android" value="android" required>Android <br>
<input type="radio" name="OS" id="IOS" value="ios" required>IOS <br>
<input type="radio" name="OS" id="Other" value="other" required>Other <br>
It is not so good to do that
<input type="radio" name="OS" id="IOS" value="ios" required>IOS <br>
because the text(IOS) is child of container or body at all so that's why you have call something like label tag and it will looks like
<input type="radio" name="OS" id="Android" value="android" required><label>Android</label> <br>
and the text will appear on the right of radio input while the following
<label>Android</label><input type="radio" name="OS" id="Android" value="android" required> <br>
text will appear on the left side of radio input and also label it is not the only tag to embed text for input but also you can use something like span, div and so on if you have any special reason
The issue was caused as I had set width: 100%
I'm learning web development and learnt big lesson whenever something is looking weird; first look at the CSS
I'm new. Just trying to learn HTML. I was working on forms and made a "build a donut" form using a couple of different forms. Everything seems to work fine.
But I saw someone else's project that also dealt with forms and their code was full of div tags where I have breaks and label for=.
So I'm just looking for feedback. Do I need the extra tags to be technically correct? Here's my code:
<!doctype>
<html>
<head>
<title>Create Your Own Donuts</title>
</head>
<h2>Fill Out The Form Below To Create Your Order</h2>
<style type="text/css">
body {
background-color: #d2b48c;
margin-left: 30%;
margin-right: 30%;
border: 2px solid black;
padding: 10px 10px 10px 10px;
font-family: sans-serif;
}
</style>
<body>
<p>
Choose Donut Base:
<select type="Base">
<option value="Base"> Cake</option>
<option value="Base"> Yeast</option>
</select>
</p>
<p>
Choose A Shape:
<select type="Topping">
<option value="Glazed">Rectangle</option>
<option value="Chocolate">Disk</option>
<option value="Powdered">Ball</option>
</select>
</p>
<p>
Choose Your Filling: <br>
<input type="radio" name="filling" value="jelly">Jelly<br>
<input type="radio" name="filling" value="cream">Cream<br>
<input type="radio" name="filling" value="none">None<br>
</p>
<p>
Toppings:
<br>
<input type="checkbox" name="toppings" vaule="Blueberries">Blueberries
<br>
<input type="checkbox" name="toppings" value="Shredded Coconut">Shredded Coconut
<br>
<input type="checkbox" name="toppings" value="Caramel Drizzle">Caramel Drizzle
<br>
<input type="checkbox" name="toppings" value="Strawberries">Strawberries
<br>
<input type="checkbox" name="toppings" value="Marshmallows">Marshmallows
<br>
<input type="checkbox" name="toppings" value="Crushed Oreos">Crushed Oreos
<br>
<input type="checkbox" name="toppings" value="Coffee Crisp">Coffee Crisps
<br>
<input type="checkbox" name="toppings" value="Whipped Cream">Whipped Cream
<br>
<input type="checkbox" name="toppings" value="Hot Fudge">Hot Fudge
<br>
<input type="checkbox" name="toppings" value="Crushed Graham Crackers">Crushed Graham Crackers
<br>
<input type="checkbox" name="toppings" value="Sprinkles">Sprinkles
<br>
<input type="checkbox" name="toppings" value="Powdered Sugar">Powdered Sugar
<br>
</p>
<p>
Hot or Cold: <br>
<input type="radio" name="Sprinkles" value="Yes">Hot <br>
<input type="radio" name="Sprinkles" value="No">Cold
</p>
<p>
Quantity:
<input type="number" min="1" max="100">
</p>
<p>
Name:
<input type="Name" placeholder="Name" required><br> Email: <input type="email" placeholder="example#gmail.com"><br> Phone Number: <input type="tel" placeholder="555.55.55" required>
<br> Pickup Date: <input type="date"> <br> Pickup Time: <input type="time">
</p>
<p>
<button input type="submit">Place Order</button>
</p>
</body>
</html>
As you can see, your code seems to work just fine without label tags. However, when creating a form, you should always use label and input tags. They belong together and it's important for accessability reasons.
Have you ever noticed when filling out a form, that you can just click on the label and it fills the checkbox or the radio button. You can achieve this by using label tags that have as their for attribute whatever the corresponding input tag has as an id. So for example:
<input type="checkbox" name="toppings" vaule="Blueberries" id="blueberries">
<label for="blueberries">Blueberries</label>
Now you can click on the label and the checkbox gets filled. Visually impaired users that use screenreaders also rely on that behaviour.
I wanted to know how to put a radio button next to another radio button in a more simple way. I am learning CSS but I cannot figure out yet how to do it. My actual code is the next one:
<form action="evaluacion.php" method="post" id="test">
Coloca el simbolo de magnitud correcto: <br><br> ¿Cuál es el símbolo de magnitud correcto de la longitud?
<br>
<div>
<input type="radio" name="pregunta1" id="pregunta1rA" value="A" required/>
<label for="pregunta1ra">T</label>
<br>
</div>
<div>
<input type="radio" name="pregunta1" id="pregunta1rB" value="B" required/>
<label for="pregunta1rb">J</label>
<br>
</div>
<div>
<input type="radio" name="pregunta1" id="pregunta1rC" value="C" required/>
<label for="pregunta1rc">N</label>
<br>
</div>
<input type="submit" value="Enviar respuestas"><br><br><br>
</form>
And my current CSS is this one: div { display: inline-block;}
This is my current code but I want to know if there is a better way to the inline sentence without using a lot of "div"
The br tags were the ones breaking it. You can accomplish this without any divs.
<body>
<form action="evaluacion.php" method="post" id="test">
Coloca el simbolo de magnitud correcto: <br><br>
¿Cuál es el símbolo de magnitud correcto de la longitud?
<br>
<input type="radio" name="pregunta1" id="pregunta1rA" value="A" required/>
<label for="pregunta1ra">T</label>
<input type="radio" name="pregunta1" id="pregunta1rB" value="B" required/>
<label for="pregunta1rb">J</label>
<input type="radio" name="pregunta1" id="pregunta1rC" value="C" required/>
<label for="pregunta1rc" >N</label>
<input type="submit" value="Enviar respuestas"><br><br><br>
</form>
https://jsfiddle.net/2k05eLjh/
In general if you do need a wrapper for something like this, you can look into wrapping a set instead of each individual item before resorting to that.
I would like to implement something similar to a google search with radio buttons. Depending on the radio button selected, would change the type of search (search,images,video, etc).
Right now I have:
<div id ="searchtext">
<form method="get" id ="searchbox" action="http://www.google.com/search"/>
<input type="text" name="q" size="30" class="searchtext" maxlength="255" value="" />
<input type="image" value="Search" class="searchbutton" src="images/searchbar/searchbutton.png"/>
<br/>
</div>
<div id="radiosearch">
<input type="radio" name="radiosearch" onclick="document.searchbox.action='http://www.google.com/search?q=';" checked="checked"/> Web
<input type="radio" name="radiosearch" onclick="document.searchbox.action='http://images.google.com/images?q=';"/>Images
<input type="radio" name="radiosearch" onclick="document.searchbox.action='http://maps.google.com/maps?hl=en&tab=wl?q=';"/>Maps
<input type="radio" name="radiosearch" onclick="document.searchbox.action='http://www.youtube.com/results?q=';"/>Youtube
<span class = "class1">
Change Theme
</span>
</div>
However, clicking on the radio boxes is not changing the form action. Any Ideas?
Try
<input type="radio" name="radiosearch" onclick="document.getElementById('searchbox').action='http://www.google.com/search?q=';" checked="checked"/> Web
<input type="radio" name="radiosearch" onclick="document.getElementById('searchbox').action='http://images.google.com/images?q=';"/>Images
<input type="radio" name="radiosearch" onclick="document.getElementById('searchbox').action='http://maps.google.com/maps?hl=en&tab=wl?q=';"/>Maps
<input type="radio" name="radiosearch" onclick="document.getElementById('searchbox').action='http://www.youtube.com/results?q=';"/>Youtube
I am a beginner with programming. I have created an HTML page with a text box, text area, select box, checkboxes, and radio buttons. I am trying to show how VBScript works with HTML for a class assignment. One of the tasks is to have a series of editing rules. The one I need help with is making sure that at least one checkbox is checked before the user can submit the form. How would I do this in VBScript?
Here is my code so far:
<html>
<head>
<script language="vbscript">
<!--
sub fred
end sub
-->
</script>
</head>
<body>
<p>
<form name="f1">
<br>
Name <input type="text" name="nametext" size="30"><p>
List your favorite things to do <P><textarea name="bigtext" rows="5" cols="40">default value</textarea>
<p>What is your favorite animal to see at the zoo?
<select name="zooanimal">
<option>default value
<option>elephants
<option>giraffes
<option>tigers
<option>seals
</select>
<p>
What is your favorite color?<br><p>
blue <input name="rb" type="radio" value="bluechecked" checked> green <input name="rb" type="radio" value="greenchecked">
pink <input name="rb" type="radio" value="pinkchecked"> yellow <input name="rb" type="radio" value="yellowchecked"> red <input name="rb" type="radio" value="redchecked"> black <input name="rb" type="radio" value="blackchecked"></p>
Which of these games do you play?<br><p>
Starcraft <input name="game" value="Starcraft" type="checkbox"> World of Warcraft <input name="game" value="WorldofWarcraft" type="checkbox">
League of Legends <input name="game" value="LeagueofLegends" type="checkbox"> none <input name="game" value="none"
type="checkbox"><P>
<p><input type="button" value="EDIT AND REPORT" onClick="fred">
<p>
<p>
</form>
</body>
</html>
If (f1.rb.checked = True) Or (f1.game.checked = True) Then