I'm having some problems with the bootstrap forms. For some reason they all get messed up.
This is what it should look like:
http://i.imgur.com/vjCZvwc.png
This is how it shows up on my page:
http://i.imgur.com/48qtLc7.png
As you can see, it makes the input box smaller and it places 'br' code behind every line. It also puts a random 'p' in it without any closing tag. (nowhere to be found on the page)
My input code:
<form>
<fieldset>
<legend>Legend</legend>
<label>Label name</label>
<input type="text" placeholder="Type something…">
<span class="help-block">Example block-level help text here.</span>
<label class="checkbox">
<input type="checkbox"> Check me out
</label>
<button type="submit" class="btn">Submit</button>
</fieldset>
</form>
The output code in the browser:
<form>
<fieldset>
<legend>Legend</legend>
<p>
<label>Label name</label><br />
<input type="text" placeholder="Type something…"><br />
<span class="help-block">Example block-level help text here.</span><br />
<label class="checkbox"><br />
<input type="checkbox"> Check me out<br />
</label><br />
<button type="submit" class="btn">Submit</button><br />
</fieldset>
</form>
So my question is; What could possibly be causing this and how do I fix it?
I'm using Bootstrap v2.3.2 as a theme on wordpress and followed this tutorial, so most of my code looks like it.
blog.teamtreehouse (dot) com/responsive-wordpress-bootstrap-theme-tutorial
Thank you for taking the time to read this. :)
This is not a problem with Bootstrap, but with your WordPress editor (or how you're using it).
You'll need to use a plain text editor or reconfigure what your editor does to HTML on save.
Related
I'm trying to style input type file using Laravel -> Form::file:
<div class="col-md-3">
{{ Form::file('images[]', ["class"=>"required","multiple"=>true]) }}
</div>
It should look like that:
I've searcched in web for some solutions and there are possibilities with js but in some of them it's commented that it's not always working in all browsers.
What should be the right way to do that?
you can solve this through "label" tag.
<label for="form-file">Upload a file</label>
<input type="file" name="file" id="form-file" class="hidden" />
Just hide the input with css or move it somewhere -9999px to the left, and style the label element to whatever you desire. When user will click on label it will show the upload popup.
I hope this help.
EDIT:
Here is example.
With "Form::file" you can just add label and add ID parametr to your function.
Here's you can attach your file in laravel
<div class="row p-t-20">
<input id="file-upload" type="file" name="banner_url" value="{{old('banner_url')}}" />
{!! $errors->first('banner_url', '
<p class="text-warning errorBag">:message</p>') !!}
<label for="file-upload" id="file-drag">
<div id="file-cont">
Select a file to upload
<br />OR
<br />Drag a file into this box
</div>
<br />
<br /><span id="file-upload-btn" class="btn btn-success">Add a file</span>
</label>
<progress id="file-progress" value="0">
<span>0</span>%
</progress>
<output for="file-upload" id="messages"></output>
this is the easy and the stylish way to input your file in laravel
please share anyone who needs this thanks
I have problem with placeholders in Wordpress Onetone theme. When I change text in placehoder tags to my preferred text it works, until I press on that field again and then text resest to it's older text. For example, I change "Email" to word "whatever" , save it, go to website, it shows word "whatever" in input area, and when i press with mouse on that area and then somewhere else, it resets back to "Email". How I could make that my text in placeholder would be permanent?
<div class="contact-area">
<form class="contact-form" method="post" action="">
<input type="text" name="name" id="name" value="" placeholder="Name" size="22" tabindex="1" aria-required="true">
<input type="text" name="email" id="email" value="" placeholder="Email" size="22" tabindex="2" aria-required="true">
<textarea name="message" id="message" cols="39" rows="7" tabindex="4" placeholder="Message"></textarea>
<p class="noticefailed"></p>
<input type="hidden" name="sendto" id="sendto" value="tomas#bandymasvienas.esy.es">
<input type="button" name="submit" id="submit" value="Post">
</form>
</div>
I found a problem. If you want to be text all time same, you need to find your .js file with your desired function and edit text in there and placeholders will show text you want.
Is there a way to style the "popup" when a field is invalid in AngularJS?
I have no idea WHERE this thing is styled? We also have Bootstrap loaded, not sure if it's there. Can't right-click to "find element" either.
That's the browser validation kicking in. Disable it as follows:
<form novalidate></form>
Edit: Example of a form using novalidate with AngularJS's validation:
<form name="form" class="css-form" novalidate>
Name:
<input type="text" ng-model="user.name" name="uName" required /><br />
E-mail:
<input type="email" ng-model="user.email" name="uEmail" required/><br />
<div ng-show="form.uEmail.$dirty && form.uEmail.$invalid">Invalid:
<span ng-show="form.uEmail.$error.required">Tell us your email.</span>
<span ng-show="form.uEmail.$error.email">This is not a valid email.</span>
</div>
</form>
I believe it is no longer possible to style these popups:
Link
I'm building a super-simple sign-up form for a mini app and thought it'd be fun to use the browser's built-in HTML5 validations if I could - so I made the text input for the form a type="email" for funsies. Load it up in Chrome (27.0.1453.116) and attempted to enter an invalid email ("lksjdf" or something, you know), and as expected an error message pops up when I attempt to submit. But the unexpected part was the validation message is offset from the text box by about 60 pixels (give or take a few)(note that the email field is active, but the error message appears to point to the password field):
If I remove all styling and just leave the markup, the validation message position is improved, but about the amount of margin and padding that were on the form field:
When I repeat the process in Firefox, the validations show up correctly.
As we're narrowing down the issue, it appears that having an <h1> tag just before the form tag causes the problem to appear - if I remove the <h1> tag then the validation message lines up correctly.
Is this a bug in Chrome? Is there a way I can force Chrome's validation messages to line up with the input correctly? Why would another tag cause it to not line up?
Here's the code so you can test/verify:
<!DOCTYPE html>
<html>
<head>
<title>Sample App | Sign Up</title>
<!-- stripped out styles and js -->
</head>
<body>
<!-- stripped out other irrelevant markup -->
<h1>Sign Up</h1>
<form accept-charset="UTF-8" action="" id="new_user" method="post">
<label for="user_name">Name</label>
<input id="user_name" name="user[name]" size="30" type="text" />
<label for="user_email">Email</label>
<!-- This is the validation test field! -->
<input id="user_email" name="user[email]" size="30" type="email" />
<label for="user_password">Password</label>
<input id="user_password" name="user[password]" size="30" type="password" />
<label for="user_password_confirmation">Confirm Password</label>
<input id="user_password_confirmation" name="user[password_confirmation]" size="30" type="password" />
<input class="btn btn-large btn-primary" name="commit" type="submit" value="Create my account" />
</form>
</body>
</html>
I've create a RSS submission form and I want to show in the input box something like Enter your email here...., and when they click on it that message should be disappear and they can put their email in the box.
Here is the code I'm using at the moment
<div id="RSS">
<form action="http://feedburner.google.com/fb/a/mailverify" class="RSS" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=RSS', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
<input type="hidden" name="uri" value="RSS">
<input type="hidden" name="loc" value="en_US">
<input name="email" id="RSS-text" type="text" maxlength="100" style="width:160px !important" value="Enter your email address..." class=""><button type="submit" id="RSS-button">Subscribe</button>
</form>
</div>
The problem is that it doesn't disappear when someone click on it, and I saw many forms including my search form it can be done that way.
You can use the placeholder attribute, but it doesn't support IE:
<input type="text" placeholder="Enter your text here..." />
Otherwise you can use a bit of javascript:
<input type="text" onfocus="if(this.value=='Enter your text here...') this.value='';" onblur="if(this.value=='') this.value='Enter your text here...';" value="Enter your text here..." />