3
I have the following code that: When a field enters Focus it calls a function to check which field is in phocus to change the value of a variable in a tooltip!
Example:
//Aqui quando o campo entra no focus ele chama a função Aalerta passando o nome!
<td align="right" >
<font face="arial" color="blue" size="-1" disabled="">Nome do Usuário : </font>
</td>
<td align="left">
<input type="text" aonfocus="Aalerta(this.name)" name="tx_nome_usua" onblur="evento(this)" id="nome" size="15" value="" >
</td>
//Essa é a tooltip que no echo do data-title eu quero mudar o valor de $j
<td><span name="tooltip" style="color: blue;" data-title="<?php echo $campo[$j]?>" class="tooltip">?</span></td>
In function Aalert()
I check the field name and want to change the value of $j
function Aalerta(nome){
switch(nome){
case 'tx_nome_usua' :
var value = 1;
document.getElementsByName('tooltip')[0].setAttribute("data-title",[+ value]);
break;
}
return true;
}
</script>
So I would like to know: "How to set the value that I determine in the case, to stand in the place of the $j!"
If you are going to follow the scope after running JS' I wanted it to look like this in the span do html
:
<td><span name="tooltip" style="color: blue;" data-title="<?php echo $campo['1']?>" class="tooltip">?</span></td>
Changing only the $j
!
Alexandre, can you use libraries like Mootools or jQuery? I’d like to get you on chat because there are concepts I think are still unclear between client and server side.
– Sergio
unfortunately I cannot use such libraries by "technical" means of work!
– Alexandre
Alexandre, we can conclude that this answer was clarified with the chat? if you want to accept.
– Sergio
Yes we can clarify that everything was correct' Thanks for the support'
– Alexandre