Hello every one i have some boxes with bbcode under each image but now I want to show up a litte box under the textarea if you click into the textbox.
My Codeidea:
$info['Show Pic<br>to a friend']='<textarea type="text" name="text" rows=2 cols=60 onclick="focus();select();copy(this.value); readonly="readonly">'.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/').basename($_SERVER['PHP_SELF'])."?pos=-$CURRENT_PIC_DATA[pid]".'</textarea><div align="center" id="box1" style="border: 1px solid #FF0042; visibility:hidden; background-color: #FFE7ED">My Text</div>';
So this <div align="center" id="box1" style="border: 1px solid #FF0042; visibility:hidden; background-color: #FFE7ED">My Text</div>';
is a little box and should be only show if you click on the textarea. So you have to set visibility:visible;
My Idea was to put that code behind the onclick of the textarea:
document.getElementById('box1').style.visibility = 'visible';
So the full code is:
$info['Show Pic<br>to a friend']='<textarea type="text" name="text" rows=2 cols=60 onclick="focus();select();copy(this.value); document.getElementById('box1').style.visibility = 'visible'; readonly="readonly">'.$CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/').basename($_SERVER['PHP_SELF'])."?pos=-$CURRENT_PIC_DATA[pid]".'</textarea><div align="center" id="box1" style="border: 1px solid #FF0042; visibility:hidden; background-color: #FFE7ED">My Text</div>';
But the problem is if I add this code
document.getElementById('box1').style.visibility = 'visible';
thinks like focus(); select(); copy(this.value); doesn't work.
I hope you can help me and tell me how I have to change te code.
Thx
Best Regards
Crazymodder