Issue with Title Atribute in TAG

ZrzaTurkl

New Member
Look, I'm building a visual keyboard with radioButtons and checkboxes.The idea is to get specific information from a database and separate it into 2 variables. Then, build some HTML estructure with DIVs, SPANs tags and some inputs and use some CSS for giving the appearence of a button. After that, fill these estructures with the information gotten at the begining. And then, passing it to an array that will be ready to be called via ajax for some DIVs container when necesary.I'm building these estructures in two separated group: one using radiobuttons and another using checkboxes.The problem appear when I want to fill a information with the title attribute. It crashed and any result appears.This issue appears when I'm working with the checkbox's group.A note is that, I realized that this issue just happens when I use the title attribute but when I remove this attribute, everything is OK.I've checked if the query I made was wrong, and it was Ok.Well this is the PHP code I'm using.I hope you can help me.constructKeyboard.php\[code\]<?php/**This is class that helps to connect to database*/include("../../Class_conexion.php");$cnx=new Conexion();/**This array will contain all the HTML estructures I'll build*/$dataSchool=array();/**Query 1**/$busquedaSalones="select sd, abrev, descrip from salones";/**Query 2**/$busquedaCursos="select cd, descrip from curso";/**Getting information*/$SalonesGot=mysql_query($busquedaSalones,$cnx->conectar())or die(mysql_error());$CursosGot=mysql_query($busquedaCursos,$cnx->conectar())or die(mysql_error());$i=0;/**String for RadioButton's group*/$domSalones="";/**Building RadioButton's group - First HTML estructure*/while($dato=mysql_fetch_assoc($SalonesGot)){ if($dato['sd']!="S0"){ $domSalones.= " <div class='boxRB_BD' > <label> <input type='radio' name='chkSalones' id='rb_".$i."' class='chkSalones' value='".$dato['sd']."' /> <span class='spnSalon' title='".$dato['descrip']."' >" .$dato['abrev']." </span> </label> </div>"; } $i++;}/**String for Checkbox's group*/$domCursos="";/**Building Checkbox's group - Second HTML estructure*/while($dato=mysql_fetch_assoc($CursosGot)){ if($dato['cd']!="C0"){ /*THIS IS WHERE IS THE ISSUE*/ /* :(*/ $domCursos.= "<div class='boxRB_BD'> <label> <input type='checkbox' id='rb_".$dato['cd']."' class='chkCursos' value='".$dato['cd']."' /> <span class='spnCurso' /*This is where is the issue*/ title='".$dato['descrip']."'>" .$dato['cd']. "</span> </label> </div>"; }}/**Setting the array for importing*/$dataSchool[0]=$domSalones;$dataSchool[1]=$domCursos;/**Encoding*//echo json_encode($dataSchool);?>\[/code\]The encoding result throws this:\[code\]["1P<\/span><\/label><\/div>2P<\/span><\/label><\/div>3P<\/span><\/label><\/div>4P<\/span><\/label><\/div>5P<\/span><\/label><\/div>6P<\/span><\/label><\/div>1S<\/span><\/label><\/div>2S<\/span><\/label><\/div>3S<\/span><\/label><\/div>4S<\/span><\/label><\/div>5S<\/span><\/label><\/div>",null]\[/code\]I don't know why I get "null". I hope you can help me :/
 
Back
Top