Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: HELP ME - JQUERY transform code in JAVA

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HELP ME - JQUERY transform code in JAVA

    HI , I need a huge help, recently I'm studying JAVA and I should turn this little project done in jQuery in JAVA language.

    HELP ME PLEASE?

    Below the public HTML and JS code:

    --- Update ---

    Quote Originally Posted by francescocar View Post
    HI , I need a huge help, recently I'm studying JAVA and I should turn this little project done in jQuery in JAVA language.

    HELP ME PLEASE?

    Below the public HTML and JS code:
    ---->HTML :

    <html>
    <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
    <script type="text/javascript" src="jquery.js"></script>
    <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
    <script type="text/javascript" src="animazioni3.js"></script>
    <LINK REL=stylesheet TYPE="text/css" HREF="prova.css" TITLE="style">
    <LINK REL=stylesheet TYPE="text/css" HREF="jquery-ui-1.10.4.custom.css" TITLE="style">

    </head>
    <body bgcolor="gray">

    <center>
    <div id="dialog-form" class="div" title="Aggiungi Contatto">
    <p class="validateTips"></p>

    <form>
    <FIELDSET>
    <LEGEND><STRONG><FONT color=red>Inserisci i Dati</FONT></STRONG></LEGEND>
    <label id="open-event" title="inserisci il tuo Nome" for="name">Nome</label>
    <input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all">
    <label id="open-event" title="inserisci il tuo Cognome" for="Cognome">Cognome</label>
    <input type="text" name="cognome" id="cognome" value="" class="text ui-widget-content ui-corner-all">
    <label id="open-event" title="inserisci la tua data di nascita" for="data">Data di nascita</label>
    <input type="text" id="datepicker" class="text ui-widget-content ui-corner-all" size="30">
    <label id="open-event" title="inserisci il tuo numero di Telefono" for="tel">Telefono</label>
    <input type="text" name="tel" id="tel" value="" class="text ui-widget-content ui-corner-all">
    </fieldset>
    </form>
    </div>

    <center>
    <p></P>
    <div id="users-contain" class="ui-widget" >
    <FIELDSET style="border-width: 2; padding: 10; width: 500">
    <LEGEND><STRONG><FONT color=black size=4pt>Rubrica</FONT></STRONG></LEGEND>
    <div align="left" >
    <br>La mia Rubrica <br>
    <TR>
    <TD colspan=2><HR></TD>
    </TR>
    </div>
    <p>Ricerca Contatto:</p>
    <input type='text' class="InpTxt1" size='10' name='campo' />
    <input type='button' value='Cerca' id="Trova" name="Cerca" />
    <button id="create-user">Inserisci Contatto</button>
    <table id="users" class="ui-widget ui-widget-content">
    <tr>
    <td class="header" id="sel">Seleziona</td>
    <td class="header">Nome</td>
    <td class="header">Cognome</td>
    <td class="header">Data di Nascita</td>
    <td class="header">Telefono</td>
    <td class="header">Cancella</td>

    </tr>
    </table>
    </div>
    <div id="dialog-confirm" title="Conferma eliminazione">
    <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Sei Sicuro di procedere con la cencellazione dei contatti selezionati ?</p>
    </div>
    <div style="display:none" class="freeow freeow-top-right" id="risultato" title="Risultato"></div>
    </fieldset>
    <button id="Elimina">Elimina Selezionati</button>
    </center>
    </body>
    </html>


    ---->JS :

    $(document).ready(function(){
    $(function() {
    var name = $( "#name" ),
    tel = $( "#tel" ),
    cognome = $( "#cognome" ),
    data = $ ("#datepicker"),
    allFields = $( [] ).add( name ).add( tel ).add( cognome ).add(data),
    tips = $( ".validateTips" );

    function updateTips( t ) {
    tips
    .text( t )
    .addClass( "ui-state-highlight" );
    setTimeout(function() {
    tips.removeClass( "ui-state-highlight", 1500 );
    }, 500 );
    }

    function checkLength( o, n, min, max ) {
    if ( o.val().length > max || o.val().length < min ) {
    o.addClass( "ui-state-error" );
    updateTips( "Verifica il campo evidenziato" );
    return false;
    } else {
    return true;
    }
    }

    function checkRegexp( o, regexp, n ) {
    if ( !( regexp.test( o.val() ) ) ) {
    o.addClass( "ui-state-error" );
    updateTips( n );
    return false;
    } else {
    return true;
    }
    }

    $( "#dialog-form" ).dialog({
    autoOpen: false,
    height: 300,
    width: 350,
    modal: true,
    buttons: {
    "Aggiungi Contatto": function() {
    var bValid = true;
    allFields.removeClass( "ui-state-error" );

    bValid = bValid && checkLength( name, "Nome", 1, 16 );
    bValid = bValid && checkLength( tel, "Telefono", 9, 10 );
    bValid = bValid && checkLength( cognome, "cognome", 1, 16 );

    bValid = bValid && checkRegexp( name, /^([a-zA-Z ])+$/, "Sono consentite solo lettere" );

    bValid = bValid && checkRegexp( tel, /^[0-9]{9}/, "Sono consentite solo numeri" );
    bValid = bValid && checkRegexp( cognome, /^([a-zA-Z ])+$/, "Sono consentite solo lettere" );

    if ( bValid ) {
    $( "#users tbody" ).append( "<tr>" +
    "<td class='prova'><input class='elimina'type='checkbox'></td>" +
    "<td>" + name.val() + "</td>" +
    "<td>" + cognome.val() + "</td>" +
    "<td>" + data.val() + "</td>" +
    "<td>" + tel.val() + "</td>" +
    "<td><img src='images/cancella contatto.png' onclick='deleteRow(this)'/>" +
    "</tr>" );
    $( this ).dialog( "close" );
    }
    },
    Chiudi: function() {
    $( this ).dialog( "close" );
    }
    },
    hide: {
    effect: "explode",
    duration: 1000
    },
    close: function() {
    allFields.val( "" ).removeClass( "ui-state-error" );
    }
    });

    $( "#create-user" )
    .button()
    .click(function() {
    $( "#dialog-form" ).dialog( "open" );
    });
    });

    $(function() {
    $( "#open-event" ).tooltip({
    show: null,
    position: {
    my: "left top",
    at: "left bottom"
    },
    open: function( event, ui ) {
    ui.tooltip.animate({ top: ui.tooltip.position().top + 10 }, "fast" );
    }
    });
    });

    //funzione trova
    $('#Trova').click(function () {
    PulisciRubrica('users');
    var valore = $('.InpTxt1').val(); //document.Rubrica.campo.value;
    var table = $('#users');
    var celle = $('td');
    var contatore = 0;
    for (var i = 0; i < celle.length; i++) {
    if (celle[i].innerHTML == valore) {

    html=('<p></p> <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span><p>Ecco il to numero: </p>' + celle[i + 1].innerHTML);
    $( "#risultato" ).html("");
    $( "#risultato" ).html(html);
    $( "#risultato" ).dialog( "open" );

    celle[i].className = 'trovato';
    }
    }
    });

    function PulisciRubrica(){
    var table = $('users');
    var celle = $('td');
    for (var i = 0; i < celle.length; i++) {
    celle[i].className = 'default';
    }
    }

    //tasto cerca
    $( "#risultato" ).dialog({
    autoOpen: false,
    buttons: {
    Ok: function() {
    $( this ).dialog( "close" );
    }
    }
    });

    //data di nascita
    $(function() {
    $( "#datepicker" ).datepicker();
    });



    /*$('#Elimina').click(function() { // When delete marked items button is clicked
    // Find checked inputs within #users table,
    // then find their surrounding rows and delete them
    $('#users input:checked').closest('tr').remove();
    }); */


    // conferma cancellazione
    $(function() {
    $( "#dialog-confirm" ).dialog({
    autoOpen: false,
    height:140,
    modal: true,
    buttons: {
    "Elimina": function() {
    console.log('prova');
    $('#users input:checked').closest('tr').remove();
    $( this ).dialog( "close" );
    },
    "Annulla": function() {
    $( this ).dialog( "close" );
    }
    }
    });
    });

    $( "#Elimina" ).click(function() {
    $( "#dialog-confirm" ).dialog( "open" );
    });




    });


    //funzione javascript
    function deleteRow(r)
    {
    var i = r.parentNode.parentNode.rowIndex;
    document.getElementById("users").deleteRow(i);

    };


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,043
    My Mood
    Mellow
    Thanks
    184
    Thanked 648 Times in 635 Posts

    Default Re: HELP ME - JQUERY transform code in JAVA

    We don't translate code from one programming language to another for free and probably never for students. Please come back and ask specific questions when you have Java code that you need help with.

    And JavaScript is not Java.

    Thread closed.

Similar Threads

  1. HELP ME - da JQUERY a JAVA
    By francescocar in forum Other Programming Languages
    Replies: 2
    Last Post: March 11th, 2014, 05:29 AM
  2. Transform file into java applet using Graphics
    By radulescuiulia in forum Java Theory & Questions
    Replies: 3
    Last Post: July 2nd, 2013, 02:53 PM
  3. java script/PHP/Jquery Help
    By lovelyxalice in forum Other Programming Languages
    Replies: 4
    Last Post: March 25th, 2012, 10:59 AM
  4. help please with code for inverse radon transform
    By sc3105 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 29th, 2011, 11:17 PM
  5. how to transform an html file to a web site in java
    By nasi in forum Java Theory & Questions
    Replies: 9
    Last Post: March 28th, 2010, 11:06 PM