Ir para conteúdo
Fórum Script Brasil

fercosmig

Moderadores
  • Total de itens

    4.048
  • Registro em

  • Última visita

Posts postados por fercosmig

  1. <html>

    <head>

    <title>Untitled</title>

    <script language="JavaScript" type="text/javascript">

    <!--

    function valida(){

    if (document.getElementById('nome').value != '' && document.getElementById('telefone').value != ''){

    return true;

    }else{

    alert('Campos: Nome e Telefone são obrigatório!');

    return false;

    }

    }

    //-->

    </script>

    </head>

    <body>

    <form name="form1" onsubmit="return valida();" action="teste.asp">

    Nome: <input id="nome" name="txtnome" type="text" /><br>

    Telefone: <input id="telefone" name="txtel" type="text" /><br>

    <input name="btnvai" type="submit" value="Vai" />

    </form>

    </body>

    </html>

    amigo, olha ae um script de validação! é só adaptar pra seu caso!

    abraços

    ----- edited -----

    opa! o link que a andreia postou ae! é melhor ainda!

    abraços

  2. usa o collspan & rowspan

    da uma olhada neste exemplo, faz uns testes que você vai entender!

    <html>
    <body>
    <table border="1" bgcolor="#000099" width="25%">
    <tr bgcolor="#6699ff">
    <td align="center" valign="middle" rowspan="2">Banana</td>
    <td align="center" valign="middle">Cebola</td>
    <td align="center" valign="middle" colspan="2">Pipoca</td>
    </tr>
    <tr bgcolor="#6699ff">
    <td align="center" valign="middle" rowspan="2">Cotovelo</td>
    <td align="center" valign="middle">Roda</td>
    <td align="center" valign="middle" rowspan="3">Madeira</td>
    </tr>
    <tr bgcolor="#6699ff">
    <td align="center" valign="middle">Caneta</td>
    <td align="center" valign="middle" rowspan="3">Lápis</td>
    </tr>
    <tr bgcolor="#6699ff">
    <td align="center" valign="middle">Pedra</td>
    <td align="center" valign="middle">Sabonete</td>
    </tr>
    <tr bgcolor="#6699ff">
    <td align="center" valign="middle" colspan="2" rowspan="2">Cerveja</td>
    <td align="center" valign="middle">Maria Mole</td>
    </tr>
    <tr bgcolor="#6699ff">
    <td align="center" valign="middle">Rabo de Galo</td>
    <td align="center" valign="middle">Smirnoff</td>
    </tr>
    </table>
    </body>
    </html>
    

    abraços

  3. da uma olhada neste codigo que eu peguei ae, os creditos estão ae!

    copia ele na integra e faz um teste ae:

    <html>

    <body>

    <div id="link" style="width: 100px; height: 5px; padding: 8px; background-color: #ffffcc; border: solid 1px #000000">

    <a OnClick="if (document.getElementById('paleta').style.display == '') { document.getElementById('paleta').style.display = 'none' } else { document.getElementById('paleta').style.display = '' }">

    <b>Paleta de cores</b></a></div>

    <br>

    <div id="paleta" style="width: 100px; display: none; padding: 8px; background-color: #ffffcc; border: solid 1px #000000">

    <script LANGUAGE="JavaScript">

    <!--

    // Copyright © 1996-1997 Tomer Shiran. All rights reserved.

    // Permission given to use the script provided that this notice remains as is.

    // Additional scripts can be found at http://www.geocities.com/~yehuda/

    // create 6-element array

    var hex = new Array(6)

    // assign non-dithered descriptors

    hex[0] = "FF"

    hex[1] = "CC"

    hex[2] = "99"

    hex[3] = "66"

    hex[4] = "33"

    hex[5] = "00"

    // accept triplet string and display as background color

    function display(triplet) {

    // set color as background color

    document.bgColor = '#' + triplet

    // display the color hexadecimal triplet

    //alert('O JavaSite Responde: A cor deste background é ' + triplet)

    }

    // draw a single table cell based on all descriptors

    function drawCell(red, green, blue) {

    // open cell with specified hexadecimal triplet background color

    document.write('<TD BGCOLOR="#' + red + green + blue + '">')

    // open a hypertext link with javascript: scheme to call display function

    document.write('<A HREF="javascript:display(\'' + (red + green + blue) + '\')">')

    // print transparent image (use any height and width)

    document.write('<IMG SRC="place.gif" BORDER=0 HEIGHT=12 WIDTH=12>')

    // close link tag

    document.write('</A>')

    // close table cell

    document.write('</TD>')

    }

    // draw table row based on red and blue descriptors

    function drawRow(red, blue) {

    // open table row

    document.write('<TR>')

    // loop through all non-dithered color descripters as green hex

    for (var i = 0; i < 6; ++i) {

    drawCell(red, hex, blue)

    }

    // close current table row

    document.write('</TR>')

    }

    // draw table for one of six color cube panels

    function drawTable(blue) {

    // open table (one of six cube panels)

    document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>')

    // loop through all non-dithered color descripters as red hex

    for (var i = 0; i < 6; ++i) {

    drawRow(hex, blue)

    }

    // close current table

    document.write('</TABLE>')

    }

    // draw all cube panels inside table cells

    function drawCube() {

    // open table

    document.write('<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=1><TR>')

    // loop through all non-dithered color descripters as blue hex

    for (var i = 0; i < 6; ++i) {

    // open table cell with white background color

    document.write('<TD BGCOLOR="#FFFFFF">')

    // call function to create cube panel with hex blue hex

    drawTable(hex)

    // close current table cell

    document.write('</TD>')

    }

    // close table row and table

    document.write('</TR></TABLE>')

    }

    // call function to begin execution

    drawCube()

    // -->

    </script>

    </div>

    </p>

    <!--mstheme-->

    </body>

    </html>

    abraços

  4. <style type="text/css">

    <!--

    .cadeira{

    font-size: 12px;

    }

    -->

    </style>

    <span class="cadeira">Fernando</span>

    <p class="cadeira">Costa</p>

    Migliorini

    assim funciona! trava o tamando do texto.

    desta forma ae! se você mudar o tamanho, só o migliorini vai alterar

    e se você fizer assim, todo o texto da pagina fica com o tamanho travado

    <!--

    body{

    font-size: 12px;

    }

    -->

    </style>

    abraços

  5. opa! agora que eu ví o, link para o site

    aqui funfou, da uma olhada!

    <tr><td>loginmenu</td></tr>

    <tr><td><table><tr><td valign="top"><table class=td><tr><td style="background-color:blue"><span class=title>Principal</span></td></tr>

    <tr><td><a href="?">Página Principal</a></td></tr>

    abraços

  6. Preencher Select conforme opção escolhida

    <script language="JavaScript" type="text/javascript">

    <!--

    function modela(){

    ma = document.form1.marcas; /* atribui a ma o primeiro Select */

    maior = document.form1.modelo; /* atribui a maior p Segundo Select */

    switch (ma.value) { /* recupera o valor do 1° Select (ma) */

    case "vw": /* caso o valor do 1º Select seja vw, adiciona os 3 itens abaixo em moe para a função */

    maior.options[0] = new Option("Escoha");

    maior.options[1] = new Option("Fusca","fsc");

    maior.options[2] = new Option("Brasilia","bra");

    break;

    case "ch":

    maior.options[0] = new Option("Escolha");

    maior.options[1] = new Option("Chevete","cvt");

    maior.options[2] = new Option("Monza","mnz");

    break;

    case "fd":

    maior.options[0] = new Option("Escolha");

    maior.options[1] = new Option("Opala","opl");

    maior.options[2] = new Option("Caravan","crv");

    break;

    }}

    function ver(){

    var ver = document.form1.modelo.value;

    if (ver == ''){

    }else{

    alert(ver);

    }

    }

    //-->

    </script>

    <form name="form1">

    <select name="marcas" id="mrc" onchange="modela();">

    <option selected>Escolha</option>

    <option value="vw" >VolksWagem</option>

    <option value="ch">Chevrolet</option>

    <option value="fd">Ford</option>

    </select>

    <select name="modelo" id="mdl" onchange="ver();"></select>

    </form>

    abraços

  7. opa! testado e funfando!

    <script language="JavaScript" type="text/javascript">

    <!--

    function modela(){

    ma = document.form1.marcas;

    mo = document.form1.modelo;

    switch (ma.value) {

    case "vw":

    mo.options[0] = new Option("Escoha");

    mo.options[1] = new Option("Fusca","fsc");

    mo.options[2] = new Option("Brasilia","bra");

    break;

    case "ch":

    mo.options[0] = new Option("Escolha");

    mo.options[1] = new Option("Chevete","cvt");

    mo.options[2] = new Option("Monza","mnz");

    break;

    case "fd":

    mo.options[0] = new Option("Escolha");

    mo.options[1] = new Option("Opala","opl");

    mo.options[2] = new Option("Caravan","crv");

    break;

    }}

    function ver(){

    var ver = document.form1.modelo.value;

    if (ver == ''){

    }else{

    alert(ver);

    }

    }

    //-->

    </script>

    </head>

    <body>

    <form name="form1">

    <select name="marcas" id="mrc" onchange="modela();">

    <option id="vazio" selected>Escolha</option>

    <option value="vw" >VolksWagem</option>

    <option value="ch">Chevrolet</option>

    <option value="fd">Ford</option>

    </select>

    <select name="modelo" id="mdl" onchange="ver();"></select>

    </form>

    abraços

×
×
  • Criar Novo...