Foros del Web » Programando para Internet » Javascript » Frameworks JS »

agregar valor a caja de texto utilizando mootools

Estas en el tema de agregar valor a caja de texto utilizando mootools en el foro de Frameworks JS en Foros del Web. buenas tardes no se si esto vaya aqui pero no supe donde ponerlo tengo una caja de texto en la cual al dalrle click me ...
  #1 (permalink)  
Antiguo 11/12/2010, 15:29
Avatar de valdo_kof  
Fecha de Ingreso: noviembre-2009
Ubicación: San Juan del Rio, Qro
Mensajes: 192
Antigüedad: 14 años, 6 meses
Puntos: 16
Pregunta agregar valor a caja de texto utilizando mootools

buenas tardes no se si esto vaya aqui pero no supe donde ponerlo

tengo una caja de texto en la cual al dalrle click me aparece una ventanita usando mootools en la cual me aparece un listado de categorias la cual la obtengo de una base de datos, supongamos:

linea blanca

salchichoneria

ropa

panaderia

las cuales son links y al darle click en linea blanca me pone otro listado supongamos:


refrigerador

estufa

etc.

tambien son links ahora mi pregunta es como le puedo hacer para que cuando seleccione estufa esta se ponga en la caja de texto inicial por la cual hago q me aparesca mi ventanita con mootools?
  #2 (permalink)  
Antiguo 12/12/2010, 01:49
Avatar de caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años, 1 mes
Puntos: 1284
Tema movido desde javascript

Pues al no saber como muestra los datos la librería, no sabría contestarte con ella, pero con ponerl un evento click a los elementos de esa lista...
document.forms.elControlQueSea.value = this.innerHTML;

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo
  #3 (permalink)  
Antiguo 12/12/2010, 10:48
Avatar de masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: agregar valor a caja de texto utilizando mootools

Deberias postear el codigo asi te podemos dar una mano.
  #4 (permalink)  
Antiguo 14/12/2010, 08:18
Avatar de valdo_kof  
Fecha de Ingreso: noviembre-2009
Ubicación: San Juan del Rio, Qro
Mensajes: 192
Antigüedad: 14 años, 6 meses
Puntos: 16
Respuesta: agregar valor a caja de texto utilizando mootools

les posteo el codigo donde se crea el lightbox con mootools ocupo mas pero este es el mas importante
Código:
jQuery.bind=function(object,method){
varargs=Array.prototype.slice.call(arguments,2);
returnfunction(){
varargs2=[this].concat(args,$.makeArray(arguments));
returnmethod.apply(object,args2);
};
};
(function($){
SexyLightbox={
getOptions:function(){
return{
name:'SLB',
zIndex:32000,
color:'black',
find:'sexylightbox',
dir:'sexyimages',
emergefrom:'top',
background:'bgSexy.png',
backgroundIE:'bgSexy.gif',
buttons:'buttons.png',
displayed:0,
showDuration:200,
closeDuration:400,
moveDuration:1000,
moveEffect:'easeInOutBack',
resizeDuration:1000,
resizeEffect:'easeInOutBack',
shake:{
distance:10,
duration:100,
transition:'easeInOutBack',
loops:2
},
BoxStyles:{'width':486,'height':320},
Skin:{'white':{'hexcolor':'#FFFFFF','captionColor':'#000000','background-color':'#000000','opacity':0.6},'black':{'hexcolor':'#000000','captionColor':'#FFFFFF','background-color':'#000000','opacity':0.6},'blanco':{'hexcolor':'#FFFFFF','captionColor':'#000000','background-color':'#000000','opacity':0.6},'negro':{'hexcolor':'#000000','captionColor':'#FFFFFF','background-color':'#000000','opacity':0.6}}
};
},
overlay:{
create:function(options){
this.options=options;
this.element=$('<divid="'+newDate().getTime()+'"></div>');
this.element.css($.extend({},{
'position':'absolute',
'top':0,
'left':0,
'opacity':0,
'display':'none',
'z-index':this.options.zIndex
},this.options.style));
this.element.bind('click',$.bind(this,function(obj,event){
if(this.options.hideOnClick){
if(this.options.callback){
this.options.callback();
}else{
this.hide();
}
}
event.preventDefault();
}));
this.hidden=true;
this.inject();
},
inject:function(){
this.target=$(document.body);
this.target.append(this.element);
if($.browser.msie&&$.browser.version=="6.0")
{
varzIndex=parseInt(this.element.css('zIndex'));
if(!zIndex)
{
zIndex=1;
varpos=this.element.css('position');
if(pos=='static'||!pos)
{
this.element.css({'position':'relative'});
}
this.element.css({'zIndex':zIndex});
}
zIndex=(!!(this.options.zIndex||this.options.zIndex===0)&&zIndex>this.options.zIndex)?this.options.zIndex:zIndex-1;
if(zIndex<0)
{
zIndex=1;
}
this.shim=$('<iframeid="IF_'+newDate().getTime()+'"scrolling="no"frameborder=0src=""></div>');
this.shim.css({
zIndex:zIndex,
position:'absolute',
top:0,
left:0,
border:'none',
opacity:0
});
this.shim.insertAfter(this.element);
}
},
resize:function(x,y){
this.element.css({'height':0,'width':0});
if(this.shim)this.shim.css({'height':0,'width':0});
varwin={x:$(document).width(),y:$(document).height()};
varchromebugfix=$.browser.safari?(win.x-25<document.body.clientWidth?document.body.clientWidth:win.x):win.x;
this.element.css({
width:x?x:chromebugfix,height:y?y:win.y
});
if(this.shim)
{
this.shim.css({'height':0,'width':0});
this.shim.css({
width:x?x:chromebugfix,height:y?y:win.y
});
}
returnthis;
},
show:function(){
if(!this.hidden)returnthis;
if(this.transition)this.transition.stop();
this.target.bind('resize',$.bind(this,this.resize));
this.resize();
if(this.shim)this.shim.css({'display':'block'});
this.hidden=false;
this.transition=this.element.fadeIn(this.options.showDuration,$.bind(this,function(){
this.element.trigger('show');
}));
returnthis;
},
hide:function(){
if(this.hidden)returnthis;
if(this.transition)this.transition.stop();
this.target.unbind('resize');
if(this.shim)this.shim.css({'display':'none'});
this.hidden=true;
this.transition=this.element.fadeOut(this.options.closeDuration,$.bind(this,function(){
this.element.trigger('hide');
this.element.css({'height':0,'width':0});
}));
returnthis;
}
},
backwardcompatibility:function(option){
this.options.dir=option.imagesdir||option.path||option.folder||option.dir;
this.options.OverlayStyles=$.extend(this.options.Skin[this.options.color],this.options.OverlayStyles||{});
},
preloadimage:function(url){
img=newImage();
img.src=url;
},
initialize:function(options){
this.options=$.extend(this.getOptions(),options);
this.backwardcompatibility(this.options);
varstrBG=this.options.dir+'/'+this.options.color+'/'+((((window.XMLHttpRequest==undefined)&&(ActiveXObject!=undefined)))?this.options.backgroundIE:this.options.background);
varname=this.options.name;
this.preloadimage(strBG);
this.preloadimage(this.options.dir+'/'+this.options.color+'/'+this.options.buttons);
this.overlay.create({
style:this.options.Skin[this.options.color],
hideOnClick:true,
zIndex:this.options.zIndex-1,
callback:$.bind(this,this.close),
showDuration:this.options.showDuration,
showEffect:this.options.showEffect,
closeDuration:this.options.closeDuration,
closeEffect:this.options.closeEffect
});
this.lightbox={};
$('body').append('<divid="'+name+'-Wrapper"><divid="'+name+'-Background"></div><divid="'+name+'-Contenedor"><divid="'+name+'-Top"style="background-image:url('+strBG+')"><aid="'+name+'-CloseButton"href="#">&nbsp;</a><divid="'+name+'-TopLeft"style="background-image:url('+strBG+')"></div></div><divid="'+name+'-Contenido"></div><divid="'+name+'-Bottom"style="background-image:url('+strBG+')"><divid="'+name+'-BottomRight"style="background-image:url('+strBG+')"><divid="'+name+'-Navegador"><strongid="'+name+'-Caption"></strong></div></div></div></div></div>');
this.Wrapper=$('#'+name+'-Wrapper');
this.Background=$('#'+name+'-Background');
this.Contenedor=$('#'+name+'-Contenedor');
this.Top=$('#'+name+'-Top');
this.CloseButton=$('#'+name+'-CloseButton');
this.Contenido=$('#'+name+'-Contenido');
this.bb=$('#'+name+'-Bottom');
this.innerbb=$('#'+name+'-BottomRight');
this.Nav=$('#'+name+'-Navegador');
this.Descripcion=$('#'+name+'-Caption');
this.Wrapper.css({
'z-index':this.options.zIndex,
'display':'none'
}).hide();
this.Background.css({
'z-index':this.options.zIndex+1
});
this.Contenedor.css({
'position':'absolute',
'width':this.options.BoxStyles['width'],
'z-index':this.options.zIndex+2
});
this.Contenido.css({
'height':this.options.BoxStyles['height'],
'border-left-color':this.options.Skin[this.options.color].hexcolor,
'border-right-color':this.options.Skin[this.options.color].hexcolor
});
this.CloseButton.css({
'background-image':'url('+this.options.dir+'/'+this.options.color+'/'+this.options.buttons+')'
});
this.Nav.css({
'color':this.options.Skin[this.options.color].captionColor
});
this.Descripcion.css({
'color':this.options.Skin[this.options.color].captionColor
});
 
this.CloseButton.bind('click',$.bind(this,function(){
this.close();
returnfalse;
}));
$(document).bind('keydown',$.bind(this,function(obj,event){
if(this.options.displayed==1){
if(event.keyCode==27){
this.close();
}
if(event.keyCode==37){
if(this.prev){
this.prev.trigger('click',event);
}
}
if(event.keyCode==39){
if(this.next){
this.next.trigger('click',event);
}
}
}
}));
$(window).bind('resize',$.bind(this,function(){
if(this.options.displayed==1){
this.replaceBox();
this.overlay.resize();
}
}));
$(window).bind('scroll',$.bind(this,function(){
if(this.options.displayed==1){
this.replaceBox();
}
}));
this.refresh();
},
hook:function(enlace){
enlace=$(enlace);
enlace.blur();
this.show((enlace.attr("title")||enlace.attr("name")||""),enlace.attr("href"),(enlace.attr('rel')||false));
},
close:function(){
this.animate(0);
},
refresh:function(){
varself=this;
this.anchors=[];
$("a,area").each(function(){
if($(this).attr('rel')&&newRegExp("^"+self.options.find).test($(this).attr('rel'))){
$(this).click(function(event){
event.preventDefault();
self.hook(this);
});
if(!($(this).attr('id')==self.options.name+"-Left"||$(this).attr('id')==self.options.name+"-Right")){
self.anchors.push(this);
}
}
});
},
animate:function(option){
if(this.options.displayed==0&&option!=0||option==1)
{
this.overlay.show();
this.options.displayed=1;
this.Wrapper.css({'display':'block'});
}
else{
this.Wrapper.css({
'display':'none',
'top':-(this.options.BoxStyles['height']+280)
}).hide();
this.overlay.hide();
this.overlay.element.bind('hide',$.bind(this,function(){
if(this.options.displayed){
if(this.Image)this.Image.remove();
this.options.displayed=0;
}
}));
}
},
/*
Cambiardetamañoyposicionarellightboxenelcentrodelapantalla
*/
replaceBox:function(data){
varsize={x:$(window).width(),y:$(window).height()};
varscroll={x:$(window).scrollLeft(),y:$(window).scrollTop()};
varwidth=this.options.BoxStyles['width'];
varheight=this.options.BoxStyles['height'];
if(this.options.displayed==0)
{
varx=0;
vary=0;
y=scroll.x+((size.x-width)/2);
if(this.options.emergefrom=="bottom")
{
x=(scroll.y+size.y+80);
}
else
{
x=(scroll.y-height)-80;
}
this.Wrapper.css({
'display':'none',
'top':x,
'left':y
});
this.Contenedor.css({
'width':width
});
this.Contenido.css({
'height':height-80
});
}
data=$.extend({},{
'width':this.lightbox.width,
'height':this.lightbox.height,
'resize':0
},data);
if(this.MoveBox)this.MoveBox.stop();
this.MoveBox=this.Wrapper.animate({
'left':(scroll.x+((size.x-data.width)/2)),
'top':(scroll.y+(size.y-(data.height+(this.navigator?80:48)))/2)
},{
duration:this.options.moveDuration,
easing:this.options.moveEffect
});
if(data.resize){
if(this.ResizeBox2)this.ResizeBox2.stop();
this.ResizeBox2=this.Contenido.animate({
height:data.height
},{
duration:this.options.resizeDuration,
easing:this.options.resizeEffect
});
if(this.ResizeBox)this.ResizeBox.stop();
this.ResizeBox=this.Contenedor.animate({
width:data.width
},{
duration:this.options.resizeDuration,
easing:this.options.resizeEffect,
complete:function(){
$(this).trigger('complete');
}
});
}
},
getInfo:function(image,id){
image=$(image);
IEuta=$('<aid="'+this.options.name+'-'+id+'"title="'+image.attr('title')+'"rel="'+image.attr('rel')+'">&nbsp;</a>');
IEuta.css({'background-image':'url('+this.options.dir+'/'+this.options.color+'/'+this.options.buttons+')'});
IEuta.attr('href',image.attr('href'));
returnIEuta;
},
display:function(url,title,force){
returnthis.show(title,url,'',force);
},
//...continua
  #5 (permalink)  
Antiguo 14/12/2010, 08:19
Avatar de valdo_kof  
Fecha de Ingreso: noviembre-2009
Ubicación: San Juan del Rio, Qro
Mensajes: 192
Antigüedad: 14 años, 6 meses
Puntos: 16
Respuesta: agregar valor a caja de texto utilizando mootools

este es la continuacion del codigo

Código:
show:function(caption,url,rel,force){
this.showLoading();
varbaseURL=url.match(/(.+)?/)[1]||url;
varimageURL=/\.(jpe?g|png|gif|bmp)/gi;
varqueryString=url.match(/\?(.+)/);
if(queryString)queryString=queryString[1];
varparams=this.parseQuery(queryString);
if(this.ResizeBox)this.ResizeBox.unbind('complete');//fixforjQuery
params=$.extend({},{
'width':0,
'height':0,
'modal':0,
'background':'',
'title':caption
},params||{});
params['width']=parseInt(params['width']);
params['height']=parseInt(params['height']);
params['modal']=parseInt(params['modal']);
this.overlay.options.hideOnClick=!params['modal'];
this.lightbox=$.extend({},params,{'width':params['width']+14});
this.navigator=this.lightbox.title?true:false;
if(force=='image'||baseURL.match(imageURL))
{
this.img=newImage();
this.img.onload=$.bind(this,function(){
this.img.onload=function(){};
if(!params['width'])
{
varobjsize=this.calculate(this.img.width,this.img.height);
params['width']=objsize.x;
params['height']=objsize.y;
this.lightbox.width=params['width']+14;
}
this.lightbox.height=params['height']-(this.navigator?21:35);
this.replaceBox({'resize':1});
this.ResizeBox.bind('complete',$.bind(this,function(){
this.showImage(this.img.src,params);
}));
});
this.img.onerror=$.bind(this,function(){
this.show('',this.options.imagesdir+'/'+this.options.color+'/404.png',this.options.find);
});
this.img.src=url;
}else
this.lightbox.height=params['height']+($.browser.opera?2:0);
this.replaceBox({'resize':1});
if(url.indexOf('TB_inline')!=-1)
{
this.ResizeBox.bind('complete',$.bind(this,function(){
this.showContent($('#'+params['inlineId']).html(),this.lightbox);
}));
}
elseif(url.indexOf('TB_iframe')!=-1)
{
varurlNoQuery=url.split('TB_');
this.ResizeBox.bind('complete',$.bind(this,function(){
this.showIframe(urlNoQuery[0],this.lightbox);
}));
}
else
{
this.ResizeBox.bind('complete',$.bind(this,function(){
$.ajax({
url:url,
type:"GET",
cache:false,
error:$.bind(this,function(){this.show('',this.options.imagesdir+'/'+this.options.color+'/404html.png',this.options.find)}),
success:$.bind(this,this.handlerFunc)
});
}));
}
}
this.next=false;
this.prev=false;
if(rel.length>this.options.find.length)
{
this.navigator=true;
varfoundSelf=false;
varexit=false;
varself=this;
$.each(this.anchors,function(index){
if($(this).attr('rel')==rel&&!exit){
if($(this).attr('href')==url){
foundSelf=true;
}else{
if(foundSelf){
self.next=self.getInfo(this,"Right");
exit=true;
}else{
self.prev=self.getInfo(this,"Left");
}
}
}
});
}
this.addButtons();
this.showNavBar(caption);
this.animate(1);
},
calculate:function(x,y){
varmaxx=$(window).width()-100;
varmaxy=$(window).height()-100;
if(x>maxx)
{
y=y*(maxx/x);
x=maxx;
if(y>maxy)
{
x=x*(maxy/y);
y=maxy;
}
}
elseif(y>maxy)
{
x=x*(maxy/y);
y=maxy;
if(x>maxx)
{
y=y*(maxx/x);
x=maxx;
}
}
return{x:parseInt(x),y:parseInt(y)};
},
handlerFunc:function(obj,html){
this.showContent(html,this.lightbox);
},
addButtons:function(){
if(this.prev)this.prev.bind('click',$.bind(this,function(obj,event){event.preventDefault();this.hook(this.prev);}));
if(this.next)this.next.bind('click',$.bind(this,function(obj,event){event.preventDefault();this.hook(this.next);}));
},
showNavBar:function(){
if(this.navigator)
{
this.bb.addClass("SLB-bbnav");
this.Nav.empty();
this.innerbb.empty();
this.innerbb.append(this.Nav);
this.Descripcion.html(this.lightbox.title);
this.Nav.append(this.prev);
this.Nav.append(this.next);
this.Nav.append(this.Descripcion);
}
else

{
this.bb.removeClass("SLB-bbnav");
this.innerbb.empty();
}
},
showImage:function(image,size){
this.Background.empty().removeAttr('style').css({'width':'auto','height':'auto'}).append('<imgid="'+this.options.name+'-Image"/>');
this.Image=$('#'+this.options.name+'-Image');
this.Image.attr('src',image).css({
'width':size['width'],
'height':size['height']
});
this.Contenedor.css({
'background':'none'
});
this.Contenido.empty().css({
'background-color':'transparent',
'padding':'0px',
'width':'auto'
});
},
showContent:function(html,size){
this.Background.empty().css({
'width':size['width']-14,
'height':size['height']+35,
'background-color':size['background']||'#ffffff'
});
this.Contenido.empty().css({
'width':size['width']-14,
'background-color':size['background']||'#ffffff'
}).append('<divid="'+this.options.name+'-Image"/>');
this.Image=$('#'+this.options.name+'-Image');
this.Image.css({
'width':size['width']-14,
'height':size['height'],
'overflow':'auto',
'background':size['height']||'#ffffff'
}).append(html);
this.Contenedor.css({
'background':'none'
});
},
showIframe:function(src,size,bg){
this.Background.empty().css({
'width':size['width']-14,
'height':size['height']+35,
'background-color':size['background']||'#ffffff'
});
varid="if_"+newDate().getTime()+"-Image";
this.Contenido.empty().css({
'width':size['width']-14,
'background-color':size['background']||'#ffffff',
'padding':'0px'
}).append('<iframeid="'+id+'"frameborder="0"></iframe>');
this.Image=$('#'+id);
this.Image.css({
'width':size['width']-14,
'height':size['height'],
'background':size['background']||'#ffffff'
}).attr('src',src);
this.Contenedor.css({
'background':'none'
});
},
showLoading:function(){
this.Background.empty().removeAttr('style').css({'width':'auto','height':'auto'});
this.Contenido.empty().css({
'background-color':'transparent',
'padding':'0px',
'width':'auto'
});
this.Contenedor.css({
'background':'url('+this.options.imagesdir+'/'+this.options.color+'/loading.gif)no-repeat50%50%'
});
this.Contenido.empty().css({
'background-color':'transparent',
'padding':'0px',
'width':'auto'
});
this.replaceBox($.extend(this.options.BoxStyles,{'resize':1}));
},
parseQuery:function(query){
if(!query)
return{};
varparams={};
varpairs=query.split(/[;&]/);
for(vari=0;i<pairs.length;i++){
varpair=pairs[i].split('=');
if(!pair||pair.length!=2)
continue;
params[unescape(pair[0])]=unescape(pair[1]).replace(/\+/g,'');
}
returnparams;
},
shake:function(){
vard=this.options.shake.distance;
varl=this.Wrapper.position();
l=l.left;
for(x=0;x<this.options.shake.loops;x++){
this.Wrapper.animate({left:l+d},this.options.shake.duration,this.options.shake.transition)
.animate({left:l-d},this.options.shake.duration,this.options.shake.transition);
}
this.Wrapper.animate({"left":l+d},this.options.shake.duration,this.options.shake.transition)
.animate({"left":l},this.options.shake.duration,this.options.shake.transition);
}
}
})(jQuery);
y los mando llamar en medio del head asi

Código:
<link rel="stylesheet" href="global.css" type="text/css" media="all" />
  <script type="text/javascript" src="jquery.min.js"></script>
  <script type="text/javascript" src="jquery.easing.1.3.js"></script>
  <script type="text/javascript" src="sexylightbox.v2.3.jquery.min.js"></script>
  <link rel="stylesheet" href="sexylightbox.css" type="text/css" media="all" />
   <script type="text/javascript">
    $(document).ready(function(){
      SexyLightbox.initialize({color:'black', dir: 'sexyimages'});
    });
  </script>
como ven necesito mas paginas js y css para que funcione, pero como ya mensione el mas importante es sexylightbox.v2.3.jquery.js

y cuando lo ocupo en la caja de texto hago que la ventana aparesca con un href de esta forma

Código:
<div id="login-form">
<a class="pureCssMenui" href="ingresar_datos.jsp?height=350&amp;width=360&amp" title="Escoger Dato" target="_blank" rel="sexylightbox">Escoger Datos: <input name="cajadestino" type="text" id="cajadestino" ></a>
</div>
<script type="text/javascript">
document.write(unescape("%3Cscript src='ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2851998-1");
pageTracker._trackPageview();
</script>
</div>
y en caja destino necesito que me ponga lo que seleccione en mi ventana motools

por cierto los js no son propios, y se pueden modificar para hacerlos mas funcionales

espero y me puedan ayudar caricatos y masterpupet

Última edición por valdo_kof; 14/12/2010 a las 08:29
  #6 (permalink)  
Antiguo 14/12/2010, 11:05
Avatar de masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: agregar valor a caja de texto utilizando mootools

Amigo lo que estas utilizando es JQuery.
  #7 (permalink)  
Antiguo 14/12/2010, 11:09
Avatar de valdo_kof  
Fecha de Ingreso: noviembre-2009
Ubicación: San Juan del Rio, Qro
Mensajes: 192
Antigüedad: 14 años, 6 meses
Puntos: 16
Respuesta: agregar valor a caja de texto utilizando mootools

ya se que uso jQuery pero el detalle es q en estos hace referencia a la libreria mootools
solo puse los mas importantes, segun yo, pero si quieres te puedo poner todos los codigos

o con jquery no se puede hacer lo q quiero?
  #8 (permalink)  
Antiguo 14/12/2010, 14:05
Avatar de masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: agregar valor a caja de texto utilizando mootools

A ver si entiendo bien, cuando le das click a un textarea te muestra el lightbox y dentro de este te muestra una lista de categorias que al clickear en alguno de los elementos te muestra una subcategoria, es asi?, estas subcategorias se cargan con js o se recarga la pagina?, porque el codigo es del lightbox pero no veo el codigo donde asignas el evento click a los elementos de la lista, para poder asignarlos a tu textarea.

PD: si tuvieras un ejemplo online seria mas fácil de captar la idea.
  #9 (permalink)  
Antiguo 14/12/2010, 14:33
Avatar de valdo_kof  
Fecha de Ingreso: noviembre-2009
Ubicación: San Juan del Rio, Qro
Mensajes: 192
Antigüedad: 14 años, 6 meses
Puntos: 16
Pregunta Respuesta: agregar valor a caja de texto utilizando mootools

nunca mencione un text area, sino una caja de texto (un textfiel o como le conoscas), me explico inicialmente al implementar esto le daba click a mi caja de texto y me salia una ventana en la cual me mostraba una lista de lo que sea, pero esta ventana me la abre sobre donde tengo dibujada o visualizada mi caja de texto, y cuando le doy click en una opcion de esa lista que me ponga lo que seleccione en la caja de texto pero lo ultimo que postie lo hago con un link digamos


AGREGAR DATOS: |________________|

donde agregar datos es el link que me va a abrir mi ventana mootools

y cuando en la lista que mensione arriba seleccione digamos refrigerador este se coloque en la caja de texto


AGREGAR DATOS: |refrigerador|

donde |____________| es mi caja de texto

no se si me explique

de cualquier forma gracias por tomarte el tiempo de atender mi solicitud
  #10 (permalink)  
Antiguo 14/12/2010, 15:29
Avatar de masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: agregar valor a caja de texto utilizando mootools

Deberias agregar al final de showContent la funcionalidad que necesitas, con Moo seria algo asi:


Código Javascript:
Ver original
  1. showContent: function(html,size){
  2. ...
  3. $(this.options.name + '-Image').getElements('a.selectable').addEvent('click', function(e){           
  4.    e.stop();  
  5.    this.getNext('input').set('value', this.get('text'));
  6. });
  7. ...
  8. }

En el ejemplo asumo que las categorias son un "a" con la clase selectable y que el textfield es el siguiente elemento, si me mostras el html real te lo ajusto.

salu2.
  #11 (permalink)  
Antiguo 15/12/2010, 09:55
Avatar de valdo_kof  
Fecha de Ingreso: noviembre-2009
Ubicación: San Juan del Rio, Qro
Mensajes: 192
Antigüedad: 14 años, 6 meses
Puntos: 16
Respuesta: agregar valor a caja de texto utilizando mootools

ok mira te posteo mi codigo, este es mi pagina agregar_insumo

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Documento sin t&iacute;tulo</title>
  6. <link rel="stylesheet" href="global.css" type="text/css" media="all" />
  7. <script type="text/javascript" src="jquery.min.js"></script>
  8. <script type="text/javascript" src="jquery.easing.1.3.js"></script>
  9. <script type="text/javascript" src="sexylightbox.v2.3.jquery.min.js"></script>
  10. <link rel="stylesheet" href="sexylightbox.css" type="text/css" media="all" />
  11. <script type="text/javascript">
  12. $(document).ready(function(){
  13. SexyLightbox.initialize({color:'black', dir: 'sexyimages'});
  14. });
  15. </script>
  16. </head>
  17. <body>
  18. <div id="top">
  19. <div id="login-form">
  20. <a href="frame_insumo.php?TB_iframe=true&height=300&amp;width=400" title="Insumos" target="_blank" rel="sexylightbox"><span class="Estilo6">Ingresar Insumo.</span></a><span class="Estilo6"></span>     
  21. <input type="text" name="insumo" />
  22. </div>
  23. <script type="text/javascript">
  24.   document.write(unescape("%3Cscript src='ga.js' type='text/javascript'%3E%3C/script%3E"));
  25. </script>
  26. <script type="text/javascript">
  27.   var pageTracker = _gat._getTracker("UA-2851998-1");
  28.   pageTracker._trackPageview();
  29.  </script>
  30. </div>
  31. </body>
  32. </html>
en el cual mando llamar mi ventanita mootools que me muestra mi pagina frame_insumo en la linea
<a href="frame_insumo.php?TB_iframe=true&height=300&a mp;width=400" title="Insumos" target="_blank" rel="sexylightbox">

mi pagina frame:insumo.php contiene lo siguiente

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Documento sin t&iacute;tulo</title>
  6. </head>
  7. <frameset rows="100%,*" frameborder="NO" border="0" framespacing="0">
  8. <frame src="departamentos.php" name="arriba" id="arriba" >
  9. <frame src="UntitledFrame-3"></frameset>
  10. <noframes></noframes>
  11. </html>

en la cual me hace me manda llamar mi pagina departamentos.php donde me hace mi consulta y me muestra un listado de mis departamentos

mi pagina departamentos contiene lo siguiente:

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Basic LightFace Test</title>
  5. </head>
  6. <body>
  7. <?php
  8. include('conexion.php');
  9. $mirec_depa=$micon->execute ("SELECT * from DEPARTAMENTOS");
  10. $DEPARTAMENTO=$mirec_depa['DEPARTAMENTO']; //Sentencia para obtener todas las caracetristica de los insumos.
  11. $id=$mirec_depa['CVE_DEPARTAMENTO'];
  12. while(!$mirec_depa->eof){
  13. ?>
  14. <a href="insumo.php?dep=<?php echo $id;?>" ><span class="Estilo6"><?php  echo $DEPARTAMENTO;?></span></a><br />
  15. <?php  $mirec_depa->movenext();} ?>
  16. </body>
  17. </html>

en cada nombre de departamento me pone un link que me manda a mi pagina insumo.php mandando un parametro dep=$CVE_DEPARTAMENTO y me hace una consulta donde me muestra todos mis insumos que le pertenecen al departamento que seleccione, ahora en esa pagina es donde quiero seleccionar el insumo y me ponga lo que seleccione en la caja de texto con name="insumo" de mi pagina agregar_insumo.php

mi pagina insumo.php contiene lo siguiete:

Código PHP:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <!-- saved from url=(0051)http://jqueryfordesigners.com/demo/coda-bubble.html -->
  3. <HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Coda Bubble Example</TITLE>
  4. <META content="text/html; charset=utf-8" http-equiv=Content-type>
  5. <STYLE type=text/css media=screen>
  6. * {PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
  7. }
  8. BODY {
  9. PADDING-BOTTOM: 10px;
  10. PADDING-LEFT: 10px;
  11. PADDING-RIGHT: 10px;
  12. PADDING-TOP: 10px;
  13. font-weight: bold;
  14. }
  15. H1 {
  16. MARGIN: 14px 0px; FONT-FAMILY: "Trebuchet MS", Helvetica
  17. }
  18. P {
  19. MARGIN: 14px 0px; FONT-FAMILY: "Trebuchet MS", Helvetica
  20. }
  21. .bubbleInfo {
  22. POSITION: relative;
  23. WIDTH: 600px;
  24. TOP: 150px;
  25. LEFT: 100px
  26. }
  27. .trigger {
  28. POSITION: absolute
  29. }
  30. .popup {
  31. Z-INDEX: 50; POSITION: absolute; DISPLAY: none; BORDER-COLLAPSE: collapse
  32. }
  33. .popup TD.corner {
  34. WIDTH: 19px; HEIGHT: 15px
  35. }
  36. .popup TD#topleft {
  37. BACKGROUND-IMAGE: url(person_tooltip_images/balloon_topLeft.png)
  38. }
  39. .popup TD.top {
  40. BACKGROUND-IMAGE: url(person_tooltip_images/balloon_top.png)
  41. }
  42. .popup TD#topright {
  43. BACKGROUND-IMAGE: url(person_tooltip_images/balloon_topRight.png)
  44. }
  45. .popup TD.left {
  46. BACKGROUND-IMAGE: url(person_tooltip_images/balloon_left.png)
  47. }
  48. .popup TD.right {
  49. BACKGROUND-IMAGE: url(person_tooltip_images/balloon_right.png)
  50. }
  51. .popup TD#bottomleft {
  52. BACKGROUND-IMAGE: url(person_tooltip_images/balloon_bottomLeft.png)
  53. }
  54. .popup TD.bottom {
  55. BACKGROUND-IMAGE: url(person_tooltip_images/balloon_bottom.png); TEXT-ALIGN: center
  56. }
  57. .popup TD.bottom IMG {
  58. MARGIN: 0px auto; DISPLAY: block
  59. }
  60. .popup TD#bottomright {
  61. BACKGROUND-IMAGE: url(person_tooltip_images/balloon_bottomRight.png)
  62. }
  63. .popup TABLE.popup-contents {
  64. LINE-HEIGHT: 1.2em; BACKGROUND-COLOR: #fff; FONT-FAMILY: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", sans-serif; COLOR: #666; FONT-SIZE: 12px
  65. }
  66. TABLE.popup-contents TH {
  67. TEXT-ALIGN: right; TEXT-TRANSFORM: lowercase
  68. }
  69. TABLE.popup-contents TD {
  70. TEXT-ALIGN: left
  71. }
  72. TR#release-notes TH {
  73. TEXT-ALIGN: left; TEXT-INDENT: -9999px; BACKGROUND: url(http://jqueryfordesigners.com/demo/images/coda/starburst.gif) no-repeat right top; HEIGHT: 17px
  74. }
  75. TR#release-notes TD A {
  76. COLOR: #333}
  77. </STYLE>
  78. <SCRIPT type=text/javascript
  79. src="jquery.js"></SCRIPT>
  80. <SCRIPT type=text/javascript>
  81. <!--
  82. $(function () {
  83. $('.bubbleInfo').each(function () {
  84. var distance = 10;
  85. var time = 250;
  86. var hideDelay = 500;
  87. var hideDelayTimer = null;
  88. var beingShown = false;
  89. var shown = false;
  90. var trigger = $('.trigger', this);
  91. var info = $('.popup', this).css('opacity', 0);
  92. $([trigger.get(0), info.get(0)]).mouseover(function () {
  93. if (hideDelayTimer) clearTimeout(hideDelayTimer);
  94. if (beingShown || shown) {
  95. return;
  96. } else {
  97. beingShown = true;
  98. info.css({
  99. top: -90,
  100. left: -33,
  101. display : 'block'
  102. }).animate({
  103. top: '-=' + distance + 'px',
  104. opacity: 1
  105. }, time, 'swing', function() {
  106. beingShown = false;
  107. shown = true;
  108. });
  109. }
  110. return false;
  111. }).mouseout(function () {
  112. if (hideDelayTimer) clearTimeout(hideDelayTimer);
  113. hideDelayTimer = setTimeout(function () {
  114. hideDelayTimer = null;
  115. info.animate({
  116. top: '-=' + distance + 'px',
  117. opacity: 0
  118. }, time, 'swing', function () {
  119. shown = false;
  120. info.css('display', 'none');
  121. });
  122. }, hideDelay);
  123.  return false;
  124. });
  125. });
  126. });
  127.  //-->
  128. </SCRIPT>
  129. <META name=GENERATOR content="MSHTML 8.00.6001.18928">
  130. </HEAD>
  131. <BODY id=page>
  132. <?php $CVE_DEPARTAMENTO=$_GET['dep'];
  133. include('conexion.php');
  134. $mirec_depa=$micon->execute ("SELECT ID,PRODUCTO from productos where DEPA=".$CVE_DEPARTAMENTO);
  135. $ID=$mirec_depa['ID'];
  136. $PRODUCTO=$mirec_depa['PRODUCTO'];
  137. ?>
  138. <table width="766" border="0" >
  139. <?php while(!$mirec_depa->eof){
  140. ?><tr>
  141. <td><div class=bubbleInfo><a href=""><?php echo $PRODUCTO;//en esta linea es donde quiero que cuando lo seleccione se ponga en mi caja de texto que esta en agregar_insumo?></a></br>
  142. <table id=dpop class=popup><?php //manda llamar la funcion de las ventanas este es un apartado ajeno a todo lo que quiero hacer solo muestra un tooltip con la descripcion de mi insumo?>
  143. <tr>
  144. <td id=topleft class=corner></td>
  145. <td class=top></td>
  146. <td id=topright class=corner></td>
  147. </tr>
  148. <tr>
  149. <td class=left></td>
  150. <td><table class=popup-contents>
  151. <TBODY>
  152. <tr height="5">
  153. <?php
  154. $mirec_car=$micon->execute ("SELECT CARACTERISTICAS.NOMBRE_CARACTERISTICA as NOMBRE, CARACTERISTICAS.CVE_CARACTERISTICA as CLAVE, CATALOGO.VALOR_CARACTERISTICA as VALOR FROM CARACTERISTICAS INNER JOIN CATALOGO ON CARACTERISTICAS.CVE_CARACTERISTICA = CATALOGO.CVE_CARACTERISTICA WHERE CVE_PRODUCTO=".$ID);
  155. $NOMBRE_CARACTERISTICA=$mirec_car['NOMBRE'];
  156. $CVE_CARACTERISTICA=$mirec_car['CLAVE'];
  157. $VALOR_CARACTERISTICA=$mirec_car['VALOR'];
  158. while(!$mirec_car->eof){?>
  159. <td height="3" nowrap="nowrap" align="center"><span title="hola"><em>
  160. <?php echo $NOMBRE_CARACTERISTICA?></em>           
  161. </span><br> <?php echo $VALOR_CARACTERISTICA?></td>    
  162. <?php  $mirec_car->movenext(); }?>
  163. </tr>
  164. <tr>
  165. <td></td>
  166. </tr>
  167. <th></th>
  168. <td></td>
  169. </tr>
  170. <th></th>
  171. <td></td>      
  172. <tr>
  173. <th></th>
  174. <td></td>
  175. </tr>
  176. <tr>
  177.  <th></th>
  178. <td></td></tr>    
  179. </TBODY></table></td>
  180. <td class=right></td></tr>
  181. <tr>
  182. <td id=bottomleft class=corner></td>
  183. <td class=bottom><img alt="popup tail" src="person_tooltip_images/balloon_tail.png" width=30
  184. height=29></td>
  185.  <td id=bottomright class=corner></td>
  186. </tr>
  187. </TBODY>
  188. </table>
  189. </div></td>
  190.   </tr>  
  191.  <?php  $mirec_depa->movenext();}?>  
  192. </table>
  193. </BODY>
  194. </HTML>

lo que quiero hacer en esta pagina es que cuando le di click en la linea <a href=""><?php echo $PRODUCTO;?></a> me ponga el nombre del producto que es mi insumo en la caja de texto insumo de mi pagina agregar_insumo.php

no se si me explique de antemano gracias
  #12 (permalink)  
Antiguo 15/12/2010, 11:04
Avatar de masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: agregar valor a caja de texto utilizando mootools

Entonces deberias agregar el evento click a los "a" correspondientes, en insumos.php, podria ser algo asi:

Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. ...
  3. $('.bubbleInfo a').click(function(){
  4.    $('[name=insumo]', top.document).val(this.text());
  5.    top.SexyLightbox.close();
  6. });
  7. </script>

Prueba y nos comentas.
  #13 (permalink)  
Antiguo 15/12/2010, 11:40
Avatar de valdo_kof  
Fecha de Ingreso: noviembre-2009
Ubicación: San Juan del Rio, Qro
Mensajes: 192
Antigüedad: 14 años, 6 meses
Puntos: 16
Respuesta: agregar valor a caja de texto utilizando mootools

lo intente con el script que posteate y no jalo lo intente de esta forma:

Código PHP:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <!-- saved from url=(0051)http://jqueryfordesigners.com/demo/coda-bubble.html -->
  3. <HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Coda Bubble Example</TITLE>
  4. <META content="text/html; charset=utf-8" http-equiv=Content-type>
  5. <STYLE type=text/css media=screen>
  6. * {
  7.     PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
  8. }
  9. BODY {
  10.     PADDING-BOTTOM: 10px;
  11.     PADDING-LEFT: 10px;
  12.     PADDING-RIGHT: 10px;
  13.     PADDING-TOP: 10px;
  14.     font-weight: bold;
  15. }
  16. H1 {
  17.     MARGIN: 14px 0px; FONT-FAMILY: "Trebuchet MS", Helvetica
  18. }
  19. P {
  20.     MARGIN: 14px 0px; FONT-FAMILY: "Trebuchet MS", Helvetica
  21. }
  22. .bubbleInfo {
  23.     POSITION: relative;
  24.     WIDTH: 600px;
  25.     TOP: 150px;
  26.     LEFT: 100px
  27. }
  28. .trigger {
  29.     POSITION: absolute
  30. }
  31. .popup {
  32.     Z-INDEX: 50; POSITION: absolute; DISPLAY: none; BORDER-COLLAPSE: collapse
  33. }
  34. .popup TD.corner {
  35.     WIDTH: 19px; HEIGHT: 15px
  36. }
  37. .popup TD#topleft {
  38.     BACKGROUND-IMAGE: url(person_tooltip_images/balloon_topLeft.png)
  39. }
  40. .popup TD.top {
  41.     BACKGROUND-IMAGE: url(person_tooltip_images/balloon_top.png)
  42. }
  43. .popup TD#topright {
  44.     BACKGROUND-IMAGE: url(person_tooltip_images/balloon_topRight.png)
  45. }
  46. .popup TD.left {
  47.     BACKGROUND-IMAGE: url(person_tooltip_images/balloon_left.png)
  48. }
  49. .popup TD.right {
  50.     BACKGROUND-IMAGE: url(person_tooltip_images/balloon_right.png)
  51. }
  52. .popup TD#bottomleft {
  53.     BACKGROUND-IMAGE: url(person_tooltip_images/balloon_bottomLeft.png)
  54. }
  55. .popup TD.bottom {
  56.     BACKGROUND-IMAGE: url(person_tooltip_images/balloon_bottom.png); TEXT-ALIGN: center
  57. }
  58. .popup TD.bottom IMG {
  59.     MARGIN: 0px auto; DISPLAY: block
  60. }
  61. .popup TD#bottomright {
  62.     BACKGROUND-IMAGE: url(person_tooltip_images/balloon_bottomRight.png)
  63. }
  64. .popup TABLE.popup-contents {
  65.     LINE-HEIGHT: 1.2em; BACKGROUND-COLOR: #fff; FONT-FAMILY: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", sans-serif; COLOR: #666; FONT-SIZE: 12px
  66. }
  67. TABLE.popup-contents TH {
  68.     TEXT-ALIGN: right; TEXT-TRANSFORM: lowercase
  69. }
  70. TABLE.popup-contents TD {
  71.     TEXT-ALIGN: left
  72. }
  73. TR#release-notes TH {
  74.     TEXT-ALIGN: left; TEXT-INDENT: -9999px; BACKGROUND: url(http://jqueryfordesigners.com/demo/images/coda/starburst.gif) no-repeat right top; HEIGHT: 17px
  75. }
  76. TR#release-notes TD A {
  77.     COLOR: #333
  78. }
  79. </STYLE>
  80.  
  81. <SCRIPT type=text/javascript
  82. src="jquery.js"></SCRIPT>
  83.  
  84.   <script type="text/javascript">
  85.     $(document).ready(function(){
  86.       SexyLightbox.initialize({color:'black', dir: 'sexyimages'});
  87.     });
  88.   </script>
  89.    <script type="text/javascript">
  90.       function agregar(insumo){
  91.        $('[name=insumo]', top.document).val(insumo);
  92.        top.SexyLightbox.close();
  93.        }</script>
  94. <META name=GENERATOR content="MSHTML 8.00.6001.18928">
  95.       </HEAD>
  96.  
  97. <BODY id=page>
  98.  
  99.  
  100. <?php $CVE_DEPARTAMENTO=$_GET['dep'];
  101. include('conexion.php');
  102.  $mirec_depa=$micon->execute ("SELECT ID,PRODUCTO from productos where DEPA=".$CVE_DEPARTAMENTO);
  103.     $ID=$mirec_depa['ID'];
  104.     $PRODUCTO=$mirec_depa['PRODUCTO'];
  105.       ?>
  106. <table width="766" border="0" >
  107. <?php while(!$mirec_depa->eof){
  108.     ?>
  109.  
  110.   <tr>
  111.        
  112.    <td><a href="#" onClick="agregar('<?php echo $PRODUCTO;?>')"><?php echo $PRODUCTO;//en esta linea es donde quiero que cuando lo seleccione se ponga en mi caja de texto que esta en agregar_insumo?></a></br>
  113.        
  114.     <table id=dpop class=popup>    
  115.     <tr>
  116.       <td id=topleft class=corner></td>
  117.       <td class=top></td>
  118.       <td id=topright class=corner></td>
  119.     </tr>
  120.     <tr>
  121.       <td class=left></td>
  122.       <td><table class=popup-contents>
  123.        
  124.         <TBODY>
  125.        
  126.           <tr height="5">
  127.            <?php
  128.            $mirec_car=$micon->execute ("SELECT CARACTERISTICAS.NOMBRE_CARACTERISTICA as NOMBRE, CARACTERISTICAS.CVE_CARACTERISTICA as CLAVE, CATALOGO.VALOR_CARACTERISTICA as VALOR FROM CARACTERISTICAS INNER JOIN CATALOGO ON CARACTERISTICAS.CVE_CARACTERISTICA = CATALOGO.CVE_CARACTERISTICA WHERE CVE_PRODUCTO=".$ID);
  129.     $NOMBRE_CARACTERISTICA=$mirec_car['NOMBRE'];
  130.     $CVE_CARACTERISTICA=$mirec_car['CLAVE'];
  131.     $VALOR_CARACTERISTICA=$mirec_car['VALOR'];
  132.    
  133.            while(!$mirec_car->eof){?>
  134.             <td height="3" nowrap="nowrap" align="center"><span title="hola"><em>
  135.    
  136.     <?php echo $NOMBRE_CARACTERISTICA?></em>           
  137.             </span><br> <?php echo $VALOR_CARACTERISTICA?></td>    
  138.             <?php  $mirec_car->movenext(); }?>
  139.           </tr>
  140.           <tr>
  141.           <td></td>
  142.           </tr>
  143.             <th></th>
  144.             <td></td>
  145.           </tr>
  146.         <th></th>
  147.               <td></td>
  148.        
  149.         <tr>
  150.           <th></th>
  151.           <td></td>
  152.         </tr>
  153.         <tr>
  154.           <th></th>
  155.           <td></td>
  156.         </tr>    
  157.         </TBODY>  
  158.    
  159.         </table></td>
  160.       <td class=right></td>
  161.     </tr>
  162.     <tr>
  163.       <td id=bottomleft class=corner></td>
  164.       <td class=bottom><img alt="popup tail"
  165.       src="person_tooltip_images/balloon_tail.png" width=30
  166.     height=29></td>
  167.       <td id=bottomright class=corner></td>
  168.     </tr>
  169.     </TBODY>
  170.   </table>
  171. </div> 
  172.     </td>
  173.   </tr>
  174.  
  175.   <?php  $mirec_depa->movenext();}?>
  176.  
  177. </table>
  178.  
  179. </BODY>
  180.  
  181. </HTML>

tampoco me funciona me dice que no encuentra el objeto

tal vez estoy dando mucha lata con esto pero soy u poco nuevo en este tipo de casos el manejo de ventanas padre e hijo o popup o como se le llame

espero y me puedan ayudar
  #14 (permalink)  
Antiguo 15/12/2010, 13:29
Avatar de masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: agregar valor a caja de texto utilizando mootools

Vamos de nuevo, en el head deja esto:

Código Javascript:
Ver original
  1. ...
  2. <script type=text/javascript src="jquery.js"></script>
  3. <script type="text/javascript">
  4. $(document).ready(function(){
  5.    $('.selectable').click(function(e){
  6.        e.preventDefault();
  7.        $('[name=insumo]', top.document).val($(this).text());
  8.        top.SexyLightbox.close();
  9.    });
  10. });
  11. </script>
  12. ...

y luego en tu html.

Código HTML:
Ver original
  1. ...
  2. <a href="#" class="selectable"><?php echo $PRODUCTO; ?></a>
  3. ...

Lo teste en mi pc y funciona bien, si te da problemas son los iframes que a veces molestan un poco, si falla vas a tener que bajarte el firebug la mejor herramienta para trabajar con js y comenta que errores te muestra.
  #15 (permalink)  
Antiguo 15/12/2010, 16:36
Avatar de valdo_kof  
Fecha de Ingreso: noviembre-2009
Ubicación: San Juan del Rio, Qro
Mensajes: 192
Antigüedad: 14 años, 6 meses
Puntos: 16
Respuesta: agregar valor a caja de texto utilizando mootools

pues si tome en cuenta el codigo que me habias posteado anterior mente y pues lo unico que hice fue cambiar la referencia de mi caja de texto al ultimo me quedo asi:


Código Javascript:
Ver original
  1. <script type="text/javascript">
  2.       function agregar(valor){
  3.        top.document.getElementById("insumo").value = valor
  4.        top.SexyLightbox.close();
  5.        }</script>


y en el link hago esto

Código PHP:
Ver original
  1. <a name="release-notes" class=trigger id=release-notes href="#" onClick="agregar('<?php echo $PRODUCTO;?>')"><?php echo $PRODUCTO;?></a>


gracias por todo el tiempo que invertiste en atender mi duda masterpuppet
me ayudo de mucho tu script

Etiquetas: caja, mootools
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:32.