Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 16

Discussione: campo text in rilievo

  1. #1

    campo text in rilievo

    ciao ragazzi ho bisogno del vostro aiuto!!! ho un div con dentro una tabella con 40 campi text e vorrei che quando mi posiziono sul primo campo text affianco mi compaia un altro campo text però in rilievo.non so che comando usare per mettere in rilievo un elemento.aspetto tante risposte ciao a tutti!!!per adesso se andate sul primo campo text vedrete che ne compare un altro affianco che però non è in rilievo. vi posto il codice


    <html>
    <head>
    <title>tabella</title>

    <SCRIPT type="text/javascript">







    function prova(){
    var contenitore=document.getElementById('pippo');
    alert(contenitore.scrollTop);
    }

    function visualizza() {

    document.getElementById('ccc').innerHTML="<input type='text'>"

    }


    </script>

    </head>
    <body>
    <form name="uno" action="">
    <center><div id="pippo" style="width:450px;height:80px; overflow-x:scroll; overflow-y:scroll;border:1px solid black;">

    <table cellpadding="4" cellspacing="1" width="120%" border=0>

    <tr>
    <td width=20%><input type="text" onfocus = "visualizza();"><td width=20% id="ccc"></td>
    </td>
    </tr>


    <tr>
    <td width=20%><input type="text" name="txt" id="txtdue" >
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="txtuno">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" id="txtuno">
    </td>
    </tr>
    </div>
    <tr>
    <td width=20%><input type="text" name="5">
    </td>
    </tr>


    <tr>
    <td width=20%><input type="text" name="6">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="7">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="8">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="9">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="10">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="11">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="12">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="13">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="14">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="15">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="16">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="17">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="18">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="19">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="20">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="21">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="22">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="23">
    </td>
    </tr>


    <tr>
    <td width=20%><input type="text" name="24">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="25">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="26">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="27">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="28">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="29">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="30">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="31">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="32">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="33">
    </td>
    </tr>


    <tr>
    <td width=20%><input type="text" name="34">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="35">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="36">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="37">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="38">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="39">
    </td>
    </tr>

    <tr>
    <td width=20%><input type="text" name="40">
    </td>
    </tr>
    </table>
    </center>

    </form>






    <center>
    <form action="">





    <input type="button" value="Coordinate" onclick="prova();">

    </form>
    </div>
    </center>

    </body>
    </html>

  2. #2
    scusa, ma che significa "in rilievo"?

  3. #3
    nel senso che deve essere sollevata rispetto all'altra text area che le sta vicino

  4. #4
    nel senso che deve sembrare avere una cornice o che deve essere messa più in alto?

  5. #5
    deve essere messa più in alto

  6. #6
    cambia i primi td con

    <td width=20% height="40" valign="bottom"><input type="text" onfocus = "visualizza();"><td width=20% id="ccc" height="40" valign="top"></td>

  7. #7
    in pratica se mi posiziono sul primo campo text dovrebbe comparire una textarea che va in primo piano ma che esce dalla videata del div !!!

  8. #8
    Codice PHP:
    function visualizza() {

       var 
    elem document.createElement("input");
       
    elem.type "text";
       
    document.getElementById('pippo').parentNode.appendChild(elem);


    se invece lo vuoi prima del div sostituisci l'ultima istruzione con

    document.getElementById('pippo').parentNode.insert Before(elem, document.getElementById('pippo'));

  9. #9
    ciao grazie che mi hai risposto ma volevo si che il campo text uscisse dal div ma che rimanesse affianco al primo campo text in primo piano come si può fare??aspetto notizie grazie mille

  10. #10
    mmm dubito si possa fare una cosa simile, dato che la distanza dell'elemento nel div dal top è diversa per gli elementi che stanno nel div con scroll e fuori da esso. Non puoi calcolare con la precisione voluta la distanza dal top.
    L'unica cosa che potresti fare è inserire un div a destra di quello con scrolling ed inserire li l'input.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.