• 0
Sign in to follow this  
oblinez

comparação entre campos form

Question

ola galera não sou bom em html e estou com um problema

não consigo fazer meu script rodar no meu formulario u.u

ele tem q comparar 2 campo e ver se o que esta escrito nos 2 campos são iguais ou não

se for diferente ou estar em branco teria que aparecer uma msg abaixo do campo repetir login mas o script não da nenhuma resposta em lugar algum u.u alguém me ajuda??

<script type="text/javascript">
    function CalcularROPs(e)
    {
        var a = document.getElementById("valor").value;
            b = 1000;
            document.getElementById('rops').value=parseInt(a)*parseInt(B);
    }

    function verdadeiro(e)
    {
        var c = doacaoform.login.value;
            d = doacaoform.login2.value;
        
        if (c != d) {
            echo ("Login não Coincide");
    }
    }

    function verifica(e)
    {
        var e = doacaoform.login.value;
            f = doacaoform.login2.value;

        if(e ==""){
            echo("Login não Pode Ficar Em Branco");
    }
        if(f ==""){
            echo("Confirmação De Login não Pode Ficar Em Branco");

    }
    }
</script>
<div class="yellow_box">
<form id="doacaoform" name="doacaoform" onSubmit="verifica">
<div class="style1" align="center">[R$ 1,00 equivale à 1000 ROPs]</div>
<hr>&nbsp;<p>Login: <input type="text" id="login" name="login"> <br>
<br>
Repita o login: <input type="text" id="login2" onkeyup="return verdadeiro(event);" name="login2"> <br>
<br>
                                                Valor: R$
                                                <input style="width: 30px; padding: 2px" id="valor" onKeyUp="CalcularROPs();" value="1" size="2" type="text" name="valor"> 
                                                ,00<br>
                                                <br>
                                                ROPs:
                                                <input style="width: 60px; padding: 2px" id="rops" value="1000" readOnly type="text" name="rops">
                                                </p>
                                                <br>
                                                <input onClick="location.href='https://pagseguro.uol.com.br/security/webpagamentos/webpagto.aspx?email_cobranca=---------------------.com&amp;tipo=CP&amp;moeda=BRL&amp;item_id_1=1813&amp;item_descr_1='+document.doacaoform.login.value+'&amp;item_quant_1=1&amp;item_valor_1='+document.doacaoform.valor.value.replace(',00','')+'00&amp;item_frete_1=000'" value="Prosseguir &gt;&gt;" type="button" name="submit">
                                                <hr>
                                                <p>&nbsp;</p>
                                        </form>
                                        <div style="display: none" id="promo">
&nbsp;<hr></div>

Edited by oblinez

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this