This code how to replace the traditional radio-buttons, for custom images. You can do the same with checkboxes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Source: http://forums.laravel.com/viewtopic.php?id=2807 | |
Route::get('optgroup', function() | |
{ | |
$eat_options = array( | |
'animals' => array( | |
'cats', | |
'dogs', | |
'monkeys', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function string_to_slug (str) { | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
var to = "aaaaeeeeiiiioooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) { | |
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="estados-brasil"> | |
<option value="AC">Acre</option> | |
<option value="AL">Alagoas</option> | |
<option value="AP">Amapá</option> | |
<option value="AM">Amazonas</option> | |
<option value="BA">Bahia</option> | |
<option value="CE">Ceará</option> | |
<option value="DF">Distrito Federal</option> | |
<option value="ES">Espírito Santo</option> | |
<option value="GO">Goiás</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO `bancos` (`cod`, `banco`) VALUES (001,'001 - BANCO DO BRASIL S/A'); | |
INSERT INTO `bancos` (`cod`, `banco`) VALUES (002,'002 - BANCO CENTRAL DO BRASIL'); | |
INSERT INTO `bancos` (`cod`, `banco`) VALUES (003,'003 - BANCO DA AMAZONIA S.A'); | |
INSERT INTO `bancos` (`cod`, `banco`) VALUES (004,'004 - BANCO DO NORDESTE DO BRASIL S.A'); | |
INSERT INTO `bancos` (`cod`, `banco`) VALUES (007,'007 - BANCO NAC DESENV. ECO. SOCIAL S.A'); | |
INSERT INTO `bancos` (`cod`, `banco`) VALUES (008,'008 - BANCO MERIDIONAL DO BRASIL'); | |
INSERT INTO `bancos` (`cod`, `banco`) VALUES (020,'020 - BANCO DO ESTADO DE ALAGOAS S.A'); | |
INSERT INTO `bancos` (`cod`, `banco`) VALUES (021,'021 - BANCO DO ESTADO DO ESPIRITO SANTO S.A'); | |
INSERT INTO `bancos` (`cod`, `banco`) VALUES (022,'022 - BANCO DE CREDITO REAL DE MINAS GERAIS SA'); | |
INSERT INTO `bancos` (`cod`, `banco`) VALUES (024,'024 - BANCO DO ESTADO DE PERNAMBUCO'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
// You can use any cookie library or whatever | |
// library to access your client storage. | |
import cookie from 'cookie-machine'; | |
axios.interceptors.request.use(function(config) { | |
const token = cookie.get(__TOKEN_KEY__); | |
if ( token != null ) { | |
config.headers.Authorization = `Bearer ${token}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="escolaridade" id="escolaridade"> | |
<option value="Ensino Fundamental">Ensino Fundamental</option> | |
<option value="Ensino Medio">Ensino Medio</option> | |
<option value="Ensino Superior">Ensino Superior</option> | |
<option value="Ensino Fundamental Incompleto">Ensino Fundamental Incompleto</option> | |
<option value="Ensino Medio Incompleto">Ensino Medio Incompleto</option> | |
<option value="Ensino Superior Incompleto">Ensino Superior Incompleto</option> | |
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"UF": [ | |
{"nome": "Acre", "sigla": "AC"}, | |
{"nome": "Alagoas", "sigla": "AL"}, | |
{"nome": "Amapá", "sigla": "AP"}, | |
{"nome": "Amazonas", "sigla": "AM"}, | |
{"nome": "Bahia", "sigla": "BA"}, | |
{"nome": "Ceará", "sigla": "CE"}, | |
{"nome": "Distrito Federal", "sigla": "DF"}, | |
{"nome": "Espírito Santo", "sigla": "ES"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"value": "001", | |
"label": "Banco do Brasil S.A." | |
}, | |
{ | |
"value": "003", | |
"label": "Banco da Amazônia S.A." | |
}, | |
{ |
OlderNewer