Como posso mudar a cor da caixa de texto quando o cursor estiver nela?
Obrigado.
Mudar cor de fundo da caixa de texto...
Started By ESBF, 30/12/2002, 01:15
9 replies to this topic
#1
Posted 30/12/2002, 01:15
#2
Posted 30/12/2002, 13:46
É simples.
O que altera o estilo de um TEXTAREA, INPUT, nada mais é que uma troca de classes nos eventos ONBLUR e ONFOCUS
ONFOCUS -> Quando o cursor está ativo no field.
ONBLUR -> Quando o cursor não está ativo no field.
Bem, você precisa considerar o estado inicial do campo (desativado) também.
Para se alterar a classe do field, você usará este comando JS:
this.className = 'classe_css';
Observe que o N é maiúsculo. Isto é por causa que o JS para esta alteração é CASO-SENSITIVO!!!
Pois bem, vou faze rum exemplozinho aqui.
Eis minhas classes CSS:
<STYLE>
.frm { background-color: #f0f0f0; border: 1px solid #aaaaaa; font-family: Verdana; font-size: 8pt; }
.frm-on { background-color: white; border: 1px solid rgb(0,66,174); font-family: Verdana; font-size: 8pt; color: rgb(0,66,174); }
</STYLE>
Agora, vamos aos meus input:
<INPUT TYPE="text" NAME="usuario" CLASS="frm" ONBLUR="this.className='frm'" ONFOCUS="this.className='frm-on'">
Você também pode usar estas classes e alterações em botões, observe:
<INPUT TYPE="submit" VALUE="Manda!" CLASS="frm" ONMOUSEOVER="this.className='frm-on'" ONMOUSEOUT="this.className='frm'">
Espero ter ajudado...
Valeu,
O que altera o estilo de um TEXTAREA, INPUT, nada mais é que uma troca de classes nos eventos ONBLUR e ONFOCUS
ONFOCUS -> Quando o cursor está ativo no field.
ONBLUR -> Quando o cursor não está ativo no field.
Bem, você precisa considerar o estado inicial do campo (desativado) também.
Para se alterar a classe do field, você usará este comando JS:
this.className = 'classe_css';
Observe que o N é maiúsculo. Isto é por causa que o JS para esta alteração é CASO-SENSITIVO!!!
Pois bem, vou faze rum exemplozinho aqui.
Eis minhas classes CSS:
<STYLE>
.frm { background-color: #f0f0f0; border: 1px solid #aaaaaa; font-family: Verdana; font-size: 8pt; }
.frm-on { background-color: white; border: 1px solid rgb(0,66,174); font-family: Verdana; font-size: 8pt; color: rgb(0,66,174); }
</STYLE>
Agora, vamos aos meus input:
<INPUT TYPE="text" NAME="usuario" CLASS="frm" ONBLUR="this.className='frm'" ONFOCUS="this.className='frm-on'">
Você também pode usar estas classes e alterações em botões, observe:
<INPUT TYPE="submit" VALUE="Manda!" CLASS="frm" ONMOUSEOVER="this.className='frm-on'" ONMOUSEOUT="this.className='frm'">
Espero ter ajudado...
Valeu,
<script language="WebFórum">
// Dados:
Nome("Guilherme Blanco");
Localidade("São Carlos - SP/Brasil");
Cargo("Manutenção");
</script>
// Dados:
Nome("Guilherme Blanco");
Localidade("São Carlos - SP/Brasil");
Cargo("Manutenção");
</script>
#3
Posted 30/12/2002, 14:41
Valeu, Guilherme Blanco. Era isso mesmo que eu queria.
Obrigado.
Obrigado.
#4
Posted 31/12/2002, 02:32
Como te falei, Guilherme, era isso mesmo que eu precisava.
Acabei de fazer o teste e tudo funcionou perfeitamente.
Só tem um probleminha... são muitas caixas de texto, logo se eu precisar alterar algo terei um trabalhão.
Tem como eu atribuir uma propriedade a um conjunto de caixas de textos (pode ser todas elas)?
Um abraço.
Acabei de fazer o teste e tudo funcionou perfeitamente.
Só tem um probleminha... são muitas caixas de texto, logo se eu precisar alterar algo terei um trabalhão.
Tem como eu atribuir uma propriedade a um conjunto de caixas de textos (pode ser todas elas)?
Um abraço.
#5
Posted 14/09/2017, 21:51
Prix Boite De Lioresal cialis buy online Canada Pharmacy
Cialis Und Levitra Cialis Kaufen In Deutschland
Buy Acetazolamide No Prescription <a href=http://cialtobuy.com>generic cialis</a> Temovate
Viagra Pressione Alta cialis Antibiotics Amoxicillin Family Side
Where To Buy Provera And Clomid Online Buy Macrobid Amoxicillin Dosage Adult
Dernier Exercice Plus Longue <a href=http://cialtobuy.com>cheap cialis</a> Isotretinoin 10mg Discount Ups Without Perscription With Free Shipping
Cialis Und Levitra Cialis Kaufen In Deutschland
Buy Acetazolamide No Prescription <a href=http://cialtobuy.com>generic cialis</a> Temovate
Viagra Pressione Alta cialis Antibiotics Amoxicillin Family Side
Where To Buy Provera And Clomid Online Buy Macrobid Amoxicillin Dosage Adult
Dernier Exercice Plus Longue <a href=http://cialtobuy.com>cheap cialis</a> Isotretinoin 10mg Discount Ups Without Perscription With Free Shipping
#6
Posted 02/10/2017, 15:00
Viagra C'Est Quoi Fast Viagra Delivery levitra plus Se Vende Cialis Sin Receta Does Keflex Cause Constipation In Dogs
Tadalis Sx Prix En Pharmacie viagra online pharmacy Sale Zentel
Alli Pills Amazon Xenical Online No Prescription Uk Order Viagra At A Discount generic viagra Viagra Mit 19 Propecia How Long For Results
Tadalis Sx Prix En Pharmacie viagra online pharmacy Sale Zentel
Alli Pills Amazon Xenical Online No Prescription Uk Order Viagra At A Discount generic viagra Viagra Mit 19 Propecia How Long For Results
#7
Posted 12/10/2017, 00:17
Cialis Dove Comprare Online Propecia United Pharmacies cialis Viagra For Sale Without Prescription Cephalexin 500 Mg Dosages Amoxicillin 500 Tv
Priligy Alternatives Cialis Soft Achat Online Online Viagra Canada viagra Top Canadian Online Pharmacy Posologia Levitra Prix Du Propecia Au Canada
Priligy Indicaciones Viagra Kaufen 100mg Safer Macrobid Or Keflex viagra Precio Del Cialis En Andorra
Buy Cheap Finasteride Rosuvastatin Cheap Viagra Generico Online Italia levitra pills Ou Puis
Priligy Alternatives Cialis Soft Achat Online Online Viagra Canada viagra Top Canadian Online Pharmacy Posologia Levitra Prix Du Propecia Au Canada
Priligy Indicaciones Viagra Kaufen 100mg Safer Macrobid Or Keflex viagra Precio Del Cialis En Andorra
Buy Cheap Finasteride Rosuvastatin Cheap Viagra Generico Online Italia levitra pills Ou Puis
#8
Posted 29/10/2017, 02:09
Viagra Canada Online Cash On Delivery Fluoxetine Overseas viagra prescription Is Keflex Good For Dental Infections Buy Zithromax Z Amoxicillin Clav Drug
Buying Viagra In The Caribbean viagra online prescription Buy Tadalis Sx Low Cost Buy Brand Cialis Online Ireland Keflex And Alchole
Seguros Los Genericos De Cialis Coreg viagra El Cialis Sirve Georgia Vermox 100 Mg Progesterone Evapause
Buying Viagra In The Caribbean viagra online prescription Buy Tadalis Sx Low Cost Buy Brand Cialis Online Ireland Keflex And Alchole
Seguros Los Genericos De Cialis Coreg viagra El Cialis Sirve Georgia Vermox 100 Mg Progesterone Evapause
#9
Posted 13/11/2017, 05:23
50 Mg Di Sildenafil cialis buy online Cialis Gel Generic Macrobid Online
Venda De Viagra Online Buy Citalopram Mail Online Uk Viagra Pharmacy Reviews viagra Amoxicillin Maculopapular Virus Comprar Cialis Rosario Vente Viagra Online
Venda De Viagra Online Buy Citalopram Mail Online Uk Viagra Pharmacy Reviews viagra Amoxicillin Maculopapular Virus Comprar Cialis Rosario Vente Viagra Online
#10
Posted 08/02/2023, 18:11
Depending on the cancer stage, tumor size, lymph node involvement, and results of genetic testing, adjuvant chemotherapy may be recommended priligy tablets price The fracture rate in our retrospective cohort was comparable to that in the larger phase III randomized trials
buy cialis online without a prescription Pero si se usa por mÐÐŽs tiempo, se pueden experimentar los siguientes efectos secundarios
driponin I declare that cvs cold medicine for high blood pressure it is not only he who has won me forever, The friendship has changed, and the elves have also gained my eternal friendship, Hillary sighed, lower blood pressure Jorgen, he wants to occupy Luck s territory, high blood pressure pills 152 yes, maybe it s really to guard the demon s seal
buy cialis online without a prescription Pero si se usa por mÐÐŽs tiempo, se pueden experimentar los siguientes efectos secundarios
driponin I declare that cvs cold medicine for high blood pressure it is not only he who has won me forever, The friendship has changed, and the elves have also gained my eternal friendship, Hillary sighed, lower blood pressure Jorgen, he wants to occupy Luck s territory, high blood pressure pills 152 yes, maybe it s really to guard the demon s seal
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)