Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di satoshi
    Registrato dal
    May 2002
    Messaggi
    217

    modifica funzione di controllo su un form

    ho questo form per inviare degli sms

    sto cercando di fare una piccola modifica pero' senza esito


    praticamente dal form devo levare 3 campi

    smsprefcell
    smsdestinatario
    smsmittente


    i primi due li devo sostituire con due campi nascosti dove ci sara il mio numero di telefono


    <input type="hidden" name="smsprefcell" value="xxx">
    <input type="hidden" name="smsdestinatario" value="xxxxxxx">

    poi il campo mittente non mi serve



    ora il problema sta che non riesco a modificare il codice javascript che mi controlla il form

    qulcuno puo' auitarmi ?




    <html>
    <head>
    <SCRIPT LANGUAGE="JavaScript" src="FileMain.js"></SCRIPT>
    </head>
    <body>

    <table width="300" border="1" cellspacing="0" cellpadding="3" height="170" bordercolor=#007198>

    <style type="text/css"><!--
    .testo1 { color: #007198; font-style: bold; font-size: 11px; line-height: 10px; font-family: Arial, Helvetica, sans-serif; text-align: left }
    .testo1b { color: #007198; font-style: bold; font-size: 12px; line-height: 10px; font-family: Arial, Helvetica, sans-serif; text-align: left }
    .testo2 { color: #ff0000; font-style: bold; font-size: 14px; line-height: 10px; font-family: Arial, Helvetica, sans-serif; text-align: left }
    --></style>

    <script Language="JavaScript">
    <!--
    function messcontacar() {
    conta=160-document.smsArubaForm.smstesto.value.length ;
    document.smsArubaForm.smscar.value=conta;
    if (conta < 0) {
    smsArubaForm.smstesto.value = smsArubaForm.smstesto.value.substr(0, 160);
    document.smsArubaForm.smscar.value=0;
    }
    }

    function sms_Valid(TheForm,StrVar1,StrVar2,StrVar3,StrVar4, StrVar6,StrVar7) {
    theForm=document.smsArubaForm;
    bono=true;

    prefiss=theForm.smsprefcell.selectedIndex;
    if ( prefiss==0 | prefiss==1 | prefiss==14 | prefiss==21 | prefiss==26 | prefiss==31 ) {
    alert("Seleziona prefisso cellulare.");
    theForm.smsprefcell.focus();
    bono=false;
    }
    if (bono==true & theForm.smsdestinatario.value.length < 1) {
    alert("Attenzione: inserire numero cellulare Destinatario!");
    theForm.smsdestinatario.focus();
    bono=false;
    }
    if (bono==true & theForm.smsdestinatario.value.length < 6) {
    alert("Attenzione: lunghezza numero cellulare Destinatario non valida!");
    theForm.smsdestinatario.focus();
    bono=false;
    }
    if (bono==true & theForm.smsdestinatario.value.length > 7) {
    alert("Attenzione: numero cellulare Destinatario troppo lungo!");
    theForm.smsdestinatario.focus();
    bono=false;
    }
    if (bono==true) {
    var checkOK = "0123456789";
    var checkStr = theForm.smsdestinatario.value;
    var allValid = true;
    for (i = 0; i < checkStr.length; i++)
    {
    ch = checkStr.charAt(i);
    for (j = 0; j < checkOK.length; j++)
    if (ch == checkOK.charAt(j))
    break;
    if (j == checkOK.length) {
    allValid = false;
    break;
    }
    }
    if (!allValid) {
    alert("Inserire solo numeri nel campo Numero Cellulare.");
    theForm.smsdestinatario.focus();
    bono=false;
    }
    }
    if (bono==true & theForm.smstesto.value.length < 1) {
    alert("Attenzione: inserire testo messaggio!");
    theForm.smstesto.focus();
    bono=false;
    }

    /*if (theForm.smstesto.value.indexOf('"') != -1) {
    alert('Il carattere " non è ammesso.')
    return false
    }*/

    if (bono==false)
    {
    return false
    }
    else
    {
    GeneraCookie(StrVar1,StrVar2,StrVar3,StrVar4,StrVa r6,StrVar7)
    Redirect()
    }
    }


    /////////////////////////////////
    function Redirect()
    {
    CookieRandom = Math.random().toString()
    CookieRandom = CookieRandom.replace(".","")
    CookieRandom = CookieRandom.replace(",","")
    setCookie(CookieRandom,"1")
    window.open("ProxyPage.asp?TipoOperazione=UNO&Rand ID=" + CookieRandom,"finestra","toolbar=no,location=no,di rectories=no,status=no,menubar=no,scrollbars=no,re sizable=no,width=400,height=300,top=200,left=450")
    }


    function GeneraCookie(StrVar1,StrVar2,StrVar3,StrVar4,StrVa r6,StrVar7)
    {
    var UrlCliente = ""
    setCookie("TestoMessaggio",StrVar1)
    setCookie("NumeroMessaggio",StrVar2)
    setCookie("PrefissoMessaggio",StrVar3)
    setCookie("MittenteMessaggio",StrVar4)
    setCookie("smstipodest",StrVar6)
    setCookie("tptarget",StrVar7)
    UrlCliente = document.location.host + document.location.pathname
    setCookie("UrlCliente",UrlCliente)
    }
    ///////////////////////////////////////


    //-->
    </script>

    <form method="POST" name="smsArubaForm">
    <input type="hidden" name="tptarget" value="1">
    <input type=hidden name="smstipodest" value=30>
    <tr><td width="300">
    <table width="300" border="0" cellspacing="0" cellpadding="0">
    <tr><td colspan=2>
    <table border=0 cellpadding=0 cellspacing=0>
    <tr><td colspan=2 align="center"><font class="testo1">Numero Cellulare DESTINATARIO </font>
    <font class="testo2"> *</font></td></tr>
    <tr><td><select name="smsprefcell" style="width:80px;" class=testo1b>
    <option selected>Prefisso</option>
    <option>TIM</option>
    <option value="330">330</option>
    <option value="333">333</option>
    <option value="334">334</option>
    <option value="335">335</option>
    <option value="336">336</option>
    <option value="337">337</option>
    <option value="338">338</option>
    <option value="339">339</option>
    <option value="360">360</option>
    <option value="363">363</option>
    <option value="366">366</option>
    <option value="368">368</option>
    <option>OMNITEL</option>
    <option value="340">340</option>
    <option value="343">343</option>
    <option value="346">346</option>
    <option value="347">347</option>
    <option value="348">348</option>
    <option value="349">349</option>
    <option>WIND</option>
    <option value="320">320</option>
    <option value="323">323</option>
    <option value="328">328</option>
    <option value="329">329</option>
    <option>BLU</option>
    <option value="380">380</option>
    <option value="383">383</option>
    <option value="388">388</option>
    <option value="389">389</option>
    <option value="">H3G - 3</option>
    <option value="390">390</option>
    <option value="391">391</option>
    <option value="392">392</option>
    <option value="393">393</option>

    </select>
    </td>
    <td><input type=text name="smsdestinatario" maxlength=7 size=16 style="WIDTH: 150px"></td></tr>
    </table>
    </td></tr>
    <tr><td width="180">
    <table border=0 cellpadding=0 cellspacing=0>
    <tr><td><font class="testo1">MITTENTE (max 11 car.) </font></td></tr>
    </table>
    </td>
    <td><font class="testo1"> </font></td></tr>
    <tr><td>
    <input type=text name="smsmittente" maxlength=11 size=12 style="WIDTH: 150px">
    </td>
    <td>
    <table border=0 cellpadding=0 cellspacing=0>
    <tr><td><input type=text value="160" name="smscar" disabled
    size="3" maxlength="20" style="width:50px"></td>
    <td><font class="testo1"> Caratteri disponibili</font></td></tr>
    </table>
    </td></tr>
    <tr Valign=bottom><td height=22 colspan=2>
    <table border=0 cellpadding=0 cellspacing=0>
    <tr><td><font class="testo1">TESTO DEL MESSAGGIO (max 160 car.)</font></td>
    <td width=5><font class="testo2"> *</font></td></tr>
    </table>
    </td></tr>
    <tr><td height=56 width=256 colspan=2 Valign=top>
    <textarea cols="33" rows="3" style="scrollbar-3dlight-color: FFFFFF; scrollbar-arrow-color: 808080; scrollbar-base-color: FFFFFF; scrollbar-darkshadow-color: FFFFFF; scrollbar-face-color: FFFFFF; scrollbar-highlight-color: FFFFFF; scrollbar-shadow-color: FFFFFF; scrollbar-track-color: FFFFFF" type="text" name="smstesto" onkeyup="javascript:messcontacar();" onchange="javascript:messcontacar();" style="WIDTH: 290px"></textarea>
    </td></tr>
    <tr><td colspan=2>
    <table width="300" border="0" cellspacing="0" cellpadding="0" height="24">
    <tr><td width=130 Valign=top>
    <div align="left">
    <table border=0 cellpadding=0 cellspacing=0>
    <tr><td height=15><font class="testo2">* </font></td>
    <td><font class="testo1">campo obbligatorio</font></td></tr>
    </table>
    </div></td>
    <td width="110">
    <table border=0 cellpadding=0 cellspacing=0>
    <tr><td width=8><font class="testo2"></font></td>
    <td><input type="button" OnClick="return sms_Valid(this,document.smsArubaForm.smstesto.valu e,document.smsArubaForm.smsdestinatario.value,docu ment.smsArubaForm.smsprefcell.value,document.smsAr ubaForm.smsmittente.value,document.smsArubaForm.sm stipodest.value,document.smsArubaForm.tptarget.val ue)" name="Invia" value="Invia Messaggio" style="width:130px"></td></tr>
    </table>
    </td></tr>
    </table>
    </td></tr>
    </table>
    </td></tr>
    </form>
    </table>
    </body>
    </html>

  2. #2
    Utente di HTML.it L'avatar di satoshi
    Registrato dal
    May 2002
    Messaggi
    217
    qualcuno puo' aiutarmi?

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.