Creative Commons 3.0 RSS CSS 2.1 XHTML 1.0
Login  
Registro
 
Escrito por Yosi_ el viernes, 6 de junio de 2008

Es bastante frecuente que escribiendo un texto en un formulario web, necesitemos emplear el tabulador para indentar código, sangrar un párrafo, etc, y sin embargo al no poder hacerlo (ya que por defecto realiza la función de alternar la selección entre los elementos de la página), nos veamos obligados a introducir una serie de espacios. En momentos puntuales puede servir, pero en la mayoría de los casos resultará muy pesado.

A continuación voy a mostrar un sencillo método probado en IE, Firefox y Opera para capturar el tabulador en los formularios de vuestra web y hacer que se muestre en un "textarea". En primer lugar determinaremos el código HTML que se debe introducir en la apertura de la etiqueta:

<textarea name="texto" onkeydown="return intercept(event,this)">

Como vemos se ha añadido un evento "onkeydown" que nos permitirá controlar cada una de las pulsaciones que se produzcan sobre ese elemento, que serán atendidas por la función "intercept()". A continuación se muestra el código de dicha función:

function intercept(event,obj) {
    var key = event.keyCode ? event.keyCode : event.which ? 
        event.which : event.charCode;
    if (key == 9) {
      mostrarTab(obj); 
      return false;
    } else {
      return key;
    }
}

En este caso el procedimiento será recoger la variable "key" que contiene el código ASCII de la tecla pulsada y comprobar si corresponde al tabulador. Si no es así, se devuelve el valor para ser mostrado en pantalla. En cambio si coincide llamaremos a la función "mostrarTab()" que se encargará de colocar la tabulación donde esté situado el cursor. Dicha función será un poco más compleja, ya que habrá que tener en cuenta las diferencias entre distintos navegadores en el cálculo de la posición del cursor. El código es el siguiente:

function mostrarTab(obj) {
    rolling=obj.scrollTop;
    if(typeof obj.selectionStart == 'number') {
        // Resto de navegadores
        var start = obj.selectionStart;
        var end = obj.selectionEnd;
        obj.value = obj.value.substring(0, start)+"\t";
        obj.value+= obj.value.substring(start, obj.value.length);
        obj.focus();
        obj.selectionStart =  obj.selectionEnd= end + 2;
    } 
    else if(document.selection) {
        // Internet Explorer
        obj.focus();
        var range = document.selection.createRange();
        if(range.parentElement() != obj) return false;
        if (range.text != "") {
            if(typeof range.text == 'string'){
                document.selection.createRange().text ="\t"+range.text;
            }
            else obj.value += "\t";
        }
        else
            obj.value += "\t";
    }
    obj.scrollTop=rolling;
}

La descripción de este fragmento es bastante más tediosa y se sale del tema que nos ocupa, así que no merece la pena detallarla. Baste decir que la primera parte de la condición "if" introduce la tabulación en la posición del cursor (al principio si se trata de una selección) en todos los navegadores probados salvo Internet Explorer, mientras que la segunda lo hace en el de Microsoft. Aparte de eso sitúa el cursor al final de la cadena introducida y restaura el scroll vertical del textarea (si es que lo había), ya que se habría perdido al sustituir su contenido.
20 Comentarios Temas relacionados: JavaScript  Web 

Enviado por luis el jueves, 1 de enero de 1970

No funciona bien en firefox. Cuando quiero agregar un tabulator en una línea intermedia, desaparecen todas las líneas más abajo.
Enviado por MCITP el jueves, 1 de enero de 1970

<a href="http://www.fastitcert.com/"> MCITP</a> boot camp classes are for those who want to gain real world skills that are necessary to take your career forward. Becoming a Microsoft Certified IT Professional (MCITP) is sure to highlight your skills in IT with the prospective employers. Just having some knowledge on the Microsoft technologies alone is not sufficient.
<a href="http://www.fastitcert.com/exam-70-639-1219.html?search=1">70-639</a>
Enviado por icebreaker underwear el jueves, 1 de enero de 1970

Shopping for 2013 New icebreaker underwear - PandaHope.com
Enviado por imitation handbags el jueves, 1 de enero de 1970

Shopping for 2013 New imitation handbags - PandaHope.com
Enviado por in handbags el jueves, 1 de enero de 1970

Shopping for 2013 New in handbags - PandaHope.com
Enviado por MCSA el jueves, 1 de enero de 1970

For instance, MCSA
are not included, and MCSE numbers are only reported for the Windows 2000 track. Also, it was interesting to see that the MCSD, MCDBA and MCSA title counts have gone down in recent months. 70-515 Exam
Enviado por Replica Watches el jueves, 1 de enero de 1970

Vip Swiss Replica Watches UK - Cheap Fake Watches UK Outlet- Watch House Basel Special Report,Replica Rolex Watches the annual clock replica watches uk industry event in Basel Fake Watches International Table Fair kicked ...
Enviado por guoguo el jueves, 1 de enero de 1970

Coach Outlet Online For Mr. Obama, the trip is a chance to show Europeans that heCoach Outlet is dedicated to NATO at a time when Russia is challengingCoach Factory Outlet the postwar European order, built on theCoach Outlet Online principle of no border changes by force.Coach Factory Outlet The tension you’re seeing between Russia and the WestCoach Outlet Store Online is going to be put on display in Wales, and the presidentCoach Outlet Store Online is going to be leading that effort,” said Ivo H. DaalderCoach Factory Outlet the previous American ambassador to NATO and now head of theCoach Outlet Chicago Council on Global Affairs. Mr. Obama, he saidCoach Handbags Outlet wants to reaffirm the unity and strength of the alliance.Coach Outlet NATO leaders are trying this week to reassure allies that theCoach Outlet commitment to collective defense, in NATO’s Article 5, is solid.Chanel Outlet Online The alliance wants to show that it means what it says and will haveLouis Vuitton the capability to defend its most vulnerable members against RussianLouis Vuitton Outlet aggression, whether overt or more covert, or a hybrid, of the two, as in Ukraine.Gucci Belts The really ironic aspect here is that a re-energizedGucci Belt restrengthened NATO is Vladimir Putin’s worst nightmareCoach Outlet Online and yet it’s his tactical actions that have done just thatCoach Outlet said James G. Stavridis, who was NATO’s commander from 2009Coach Factory Outlet to 2013 and is dean of the Fletcher School at TuftsCoach Outlet Online University, referring to Russia’s president.Coach Outlet Store It is also an opportunity for Mr. Obama, buffeted by a cascadeCoach Outlet Store Online of international crises, to rally Europeans into whatCoach Outlet Secretary of State John Kerry has called a “global coalitionCoach Factory Online to confront an increased terrorist threat from the IslamicCoach Factory Outlet State in Iraq and Syria and other radical Islamist groups in Africa.Coach Factory Outlet Though ISIS is not on the formal agenda for the summit meetingCoach Outlet Mr. Kerry and Defense Secretary Chuck Hagel will meet EuropeanCoach Outlet Store Online counterparts to develop a strategy to counter ISIS.Chanel Outlet Online But the emphasis will be on Russia. As both American and EuropeanLouis Vuitton Outlet leaders weigh additional sanctions against Moscow,Louis Vuitton Handbags Anders Fogh Rasmussen, the NATO secretary general, said MondayGucci Belt in Brussels that the new rapid reaction force “willGucci Belts ensure that we have the right forces and the rightLouis Vuitton Outlet Online equipment in the right place, at the right time.Oakley Sunglasses Outlet Numerous leaders of NATO countries have said that any hopeLouis Vuitton Outlet Online of achieving the “strategic partnership” with Russia envisionedOakley Sunglasses Outlet as long ago as the 1990 NATO summit was finished because of RussiaCheap Oakley Sunglasses s annexation of Crimea and invasion of eastern Ukraine.Oakley Sunglasses Nevertheless, NATO is being careful not to violate the NATO-Russia
Enviado por xiaozhengm el jueves, 1 de enero de 1970

2016-1-30 xiaozhengm
coach factory outlet
michael kors
moncler jackets
christian louboutin outlet
michael kors
michael kors handbags
jordan 8
ralph lauren outlet
nike trainers
louis vuitton outlet
ugg boots
timberland outlet
michael kors
michael kors handbags
sac longchamp
coach outlet
coach outlet
jordan 6
coach outlet store online
ray bans
canada goose outlet
louis vuitton outlet
ugg outlet
coach outlet
michael kors bags
jordan 4
fitflop uk
ed hardy uk
oakley sunglasses
longchamp handbags
nike air max
coach outlet
michael kors outlet
louis vuitton
gucci
nike blazer
michael kors handbags
michael kors outlet online
louis vuitton outlet
cheap jordan shoes
uggs outlet
fitflops
nike outlet store
ray ban sunglasses
true religion outlet
michael kors outlet
air jordan 13
burberry outlet
coach canada outlet
gucci borse
michael kors outlet
nike roshe runs
louis vuitton handbags
oakley vault
marc jacobs
nike shoes
christian louboutin outlet
toms shoes
michael kors outlet
coach factory outlet
basketball shoes
ralph lauren uk
louis vuitton handbags
nike store
hermes uk
michael kors uk
soccer jerseys
michael kors
ugg sale
ugg boots
sac longchamp
coach outlet
new balance outlet
chaussure louboutin
louis vuitton outlet
louis vuitton
michael kors
coach outlet
jordan retro 3
canada goose uk
oakley sunglasses
pandora jewelry
ghd
adidas outlet store
coach outlet
christian louboutin uk
toms outlet
coach factory outlet
burberry outlet online
louboutin
ray ban sunglasses
kate spade handbags
louis vuitton
coach factorty outlet
adidas uk
cheap toms
kate spade
sac longchamp pas cher
nike free run
coach outlet
true religion outlet
mulberry bags
michael kors outlet
chi flat iron
michael kors handbags
mont blanc pens
burberry outlet
ugg sale
kate spade outlet
burberry outlet
toms outlet
ralph lauren pas cher
louis vuitton borse
moncler jackets
mont blanc pens
canada goose
coach outlet
cheap jordans
adidas shoes
adidas shoes uk
toms
coach factory outlet
toms shoes
gucci outlet
christian louboutin outlet
cheap ugg boots
coach outlet
gucci outlet
polo outlet
adidas gazelle
ray ban sunglasses
ed hardy outlet
nike blazers
hermes belt
polo outlet
michael kors handbags
louis vuitton outlet
michael kors outlet
coach factory outlet
michael kors outlet
pandora charms
jordan pas cher
fitflops
north face outlet
snapbacks wholesale
rolex replica watches
louboutin
tiffany and co
nike free runs
ugg boots
mizuno running shoes
hollister outlet
michael kors outlet
ugg outlet
louis vuitton handbags
coach factory outlet
michael kors outlet
abercrombie
cheap uggs boots
true religion outlet
adidas trainers
juicy couture
air jordan uk
nike uk
adidas superstars
ghd hair straighteners
ugg australia
burberry outlet
cheap uggs
ray ban sunglasses
longchamp bags
michael kors outlet online
polo ralph lauren
burberry outlet
ugg outlet
kate spade outlet
michael kors uk
michael kors outlet online
tiffany jewelry
nike outlet
mcm outlet
burberry outlet online
toms outlet
ray ban sunglasses
ray ban
ralph lauren uk
ralph lauren outlet
christian louboutin shoes
michael kors uk
ralph lauren outlet
sac longchamp pliage
oakley sunglasses
true religion jeans
ray ban outlet
air force 1
michael kors outlet
nike roshe run women
ugg boots
tory burch outlet
nike air jordan
kate spade outlet
timberland boots
louis vuitton
michael kors outlet
coach outlet
louis vuitton outlet
michael kors outlet online
michael kors handbags
cheap jordans
louboutin pas cher
fitflops
jordan 4 toro
jordan 3
nike air max shoes
coach factory outlet
ugg outlet store
nike huarache trainers
jordan 8s
caoch outlet
true religion jeans
coach outlet
nike sb shoes
kate spade outlet
ugg boots
adidas originals
louis vuitton bags
nike sb
michael kors outlet
coach factory outlet
canada goose jacket
toms outlet store
louis vuitton handbags
louis vuitton pas cher
canada goose
jordan 3 infrared
louboutin
michael kors outlet
nike tn
coach factory outlet
coach outlet
canada goose jackets
air jordan pas cher
oakley sunglasses
ture religion outlet
michael kors
ugg boots
louis vuitton
moncler outlet
nike air max uk
michael kors outlet online
michael kors outlet uk
cheap jordans
fitflops clearance
michael kors handbags
air max 95
mcm outlet
toms wedges
oakley sunglasses
longchamp outlet
toms outlet
michael kors handbags
gucci outlet
nike outlet
instyler max
michael kors outlet
jordan 13
canada goose outlet
true religion
jordan shoes
running shoes
coach factory outlet
oakley sunglasses
nike uk
true religion
christian louboutin outlet
coach outlet
canada gooses outlet
prada outlet
cheap uggs on sale
coach outlet
cheap jordan shoes
nike air max
michael kors outlet
north face jackets
christian louboutin
nike trainers
air jordans
nike cortez
ghd straighteners
michael kors uk
christian louboutin outlet
Enviado por asdsad el jueves, 1 de enero de 1970

Enviado por xiaojun el jueves, 1 de enero de 1970

20160509 junda
coach factory outlet
mizuno running shoes
burberry outlet online
ralph lauren pas cher
louis vuitton outlet
coach outlet
cheap oakley sunglasses
instyler max
louboutin pas cher
lacoste outlet
polo ralph lauren
canada goose outlet
nike air max
nike trainers
coach outlet store
yeezy boost 350
basketball shoes
nike cortez
discount nike shoes
rolex watches
pandora jewelry
louis vuitton handbags
calvin klein outlet
christian louboutin outlet
cheap jordans
longchamp outlet
hollister clothing
gucci borse
ray ban sunglass,ray ban sunglasses,ray ban outlet,cheap ray bans,cheap ray ban sunglasses,cheap ray bans,ray bans
abercrombie and fitch
michael kors outlet clearance
rolex submariner
nike air max
adidas supercolor
christian louboutin uk
bottega veneta outlet
kate spade outlet
calvin klein underwear
michael kors outlet
cheap oakley sunglasses
michael kors outlet
true religion outlet
ray ban sunglasses
converse sneakers
michael kors outlet
fitflops outlet
hollister
reebok classic shoes
nike store uk
adidas nmd runner
longchamp handbag
air max 95
michael kors bags
puma shoes
christian louboutin outlet
cheap nhl jerseys
oakley sunglasses
ghd flat iron
nike roshe run women
christian louboutin outlet
chaussure louboutin
lululemon outlet
coach outlet
yeezy boost 350
nike blazer
polo ralph lauren outlet
fake oakleys outlet
louis vuitton outlet online
cheap omega watches
ray ban sunglasses outlet
versace sunglasses
toms shoes
supra shoes
ray bans
levis jeans
michael kors watches
adidas superstars
omega watches
new balance outlet
reebok classic sale
jimmy choo outlet
jimmy choo shoes
ray ban sunglasses
hollister sale
michael kors outlet
coach factory outlet
cheap jordans
stephen curry shoes
adidas nmd
ray ban outlet
reebok shoes
supra for sale
oakley sunglasses
michael kors outlet online
valentino shoes
nike tn
lacoste shoes
ed hardy outlet
rolex replica watches
true religion jeans
kate spade outlet
skechers shoes
michael kors outlet online
ralph lauren
adidas gazelle
michael kors outlet
vans sk8 hi
ralph lauren outlet
cheap oakley sunglasses
cheap nba jerseys
bottega veneta handbags
yeezy boost 350 balck
sac longchamp pliage
valentino shoes on sale
jordan pas cher
kate spade handbags
toms outlet
oakley sunglasses
adidas stan smith
michael kors purses
ralph lauren outlet
jordan shoes
fitflops
ray bans
kate spade outlet
under armour shoes
converse all star
michael kors handbags
ecco shoes
nike huarache
michael kors outlet
coach outlet store online
michael kors outlet
burberry uk
asics gel nimbus
adidas nmd white
oakley sunglasses,oakley sunglass,cheap oakley sunglasses,oakley sunglasses cheap,oakley sunglasses outlet,oakley store,oakley outlet,oakley outlet store,oakley sunglasses sale,oakley sunglasses discount
cheap ray bans
nike air max
coach outlet
hermes belt
burberry outlet
oakley sunglasses
adidas pure boost
burberry outlet
louboutin
coach outlet
louis vuitton outlet
adidas uk
nfl jerseys wholesale
cartier watches
true religion
gucci outlet
toms outlet
designer bags
burberry outlet
cheap jordans
cheap oakley sunglasses
coach outlet
cheap jerseys wholesale
jordans shoes
babyliss pro
ray ban outlet
air jordans
polo outlet
cheap ray-ban sunglasses
asics shoes
ghd hair straighteners
fitflop uk
michael kors outlet
yeezy boost 750
sac longchamp
adidas superstar
nike huarache white
cartier love bracelet
armani watches
cheap nike shoes
micahel kors
vans shoes
ralph lauren outlet
coach factory outlet
designer handbags
versace shoes
toms wedges
pandora charms
nike free runs
ugg boots
running shoes
ralph lauren uk
coach outlet
michael kors outlet online
cheap ugg boots
under armour outlet
michael kors outlet clearance
christian louboutin
true religion outlet
polo outlet
nike cortez red
chi flat iron
michael kors outlet
coach outlet
fitflops
ray-ban sunglasses
coach outlet online
ed hardy uk
coach outlet store
adidas shoes uk
air force 1
polo ralph lauren
adidas nmd
coach outlet online
nike air max sale
michael kors bags
cheap oakley sunglasses
ralph lauren outlet
armani exchange
converse trainers
oakley sunglasses
burberry handbags
michael kors outlet online
ralph lauren outlet
coach outlet
gucci handbags
fitflops
prada sunglasses
prada outlet
cheap ferragamo shoes
nike air max uk
louis vuitton pas cher
nike air max 90
coach purses
canada goose outlet
cheap mlb jerseys
converse
reebok pump
ferragamo shoes
michael kors outlet online
michael kors handbags
michael kors outlet online
louis vuitton borse
adidas trainers
dior sunglasses
michael kors outlet
hermes uk
yeezy boost 350
adidas nmd
fitflops sale clearance
michael kors outlet clearance
lululemon sale
michael kors outlet
Enviado por zwoo el jueves, 1 de enero de 1970

scarpe nike air max
zapatilla adidas
coach factory outlet online
Nike Zapatos
Air Jordan Release Date
Ray ban sale online
ugg boots classic
air max pas cher femme
oakley sunglasses clearance
portafoglio michael kors
Toms Outlet Online
cheap air max outlet
longchamp kaufen
Timberland skor
cheap uggs for women
nike air schuhe herren
uggs outlet
Nike Air Jordan 11
nike air max 90 rea
Jordan Schoenen
chaussure Nike femme
adidas sneakers
adidas schuhe neu
chaussure basket homme
scarpe adidas online
ugg store
polo ralph lauren pas cher
nike sportschuhe
new balance sportschuhe
nfl store
toms shoes outlet
balenciaga borse
Adidas schuhe
sac a main michael kors
Air Jordan News
23 is back
nike air
womens nike air max
pandora jewelry store
louboutin heels
cheap uggs
adidas schoenen
Chaussure Nike Pas Cher
nike shoes
Uomo Hogan
adidas shoenen
discount ray bans
nike joggesko
adidas outlet
Nike Store
Ugg boots Sale
toms sale
vans shoe store
New Balance Outlet
Jordan Store
fitflop online kopen
zapatillas running
ray ban sale
reebok running shoes
nike air max running shoes
nike tn pas cher
Cheap Michael Kors
ugg factory outlet
Toms Shoes For Women
moncler jacket sale
nike free
adidas store
chaussure new balance femme
air jordan pas cher homme
sandalias birkenstock
Billig Nike
newest lebron shoes
abercrombie and fitch store
huarache sneakers
scarpe nike running
Ray Ban Outlet
asics sko
outlet zapatos online
oakley outlet
ugg boots outlet online
timberland outlet
chaussures nike pas cher
goedkope nike air max
zapatos de futbol nike
ugg outlet online
bambas adidas baratas
uggs for cheap
new yeezy shoes
ugg clearance
scarpe nike
new balance femme
scarpe hogan outlet
chaussure Nike homme
burberry sac pas cher
new jordan releases
nike jordan shoes
billige nike sko
chaussure adidas pas cher
botas de futbol
Nike Online Store
fitflops sale uk
Billiga Nike Air Max
abercrombie deutschland
cheap ray ban aviators
zapatillas nike baratas
moncler outlet
prada outlet
mulberry väskor rea
outlet scarpe new balance
ray ban sunglasses for men
cheap nike air max
nike chaussures
adidas outlet stores online
nike sneakers
ugg boots for women
ray ban wayfarer eyeglasses
scarpe running new balance
michael kors handbags on sale
zwoo 9.2
Enviado por Lound Rrment el jueves, 1 de enero de 1970

Religious constraints within Islamic jurisprudence get kept Islamic finance institutions more income awash when compared with their risk-taking Developed counterparts following recent fiscal hubbub. On the other hand, gradual reforms need to take place for the industry overall to expertise a structurally maintained positive growth down the road.

International Islamic School

Escribe tu comentario:

Nombre:
Web personal (opcional):