Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By sunde

Thread: fix this script can anyone this?

  1. #1
    New to the CF scene
    Join Date
    May 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question fix this script can anyone this?

    how could i write to link the last one #div_newaccount to another page when i try it will not search in my seach button anymore after i have try to write a conclussion so if anyone who to write please help

    it should be so a new page is open up when i click on my button.

    the last one before the script is not finished i need help!

    <script>
    $(function() {
    var account_id = 0;
    var e;
    var c = 0;
    var t;
    var u;

    setInterval(function () {

    if (c < 3) c+=1;
    else {
    if (c != 99) {
    c = 99;
    t = $("#search").val();
    if (t.length > 1) {
    t = "req.php?search=" + $("#search").val();
    if ($("#sname").attr('checked')) t += "&sname=1"; else t+= "&sname=0";
    if ($("#ssoc").attr('checked')) t += "&ssoc=1"; else t+= "&ssoc=0";
    if ($("#sacc").attr('checked')) t += "&sacc=1"; else t+= "&sacc=0";
    $("#searchresult").html("Söker...");
    $.ajax({

    url: t,
    cache: false

    }).done(function( html ) {
    $("#searchresult").html(html);
    });
    }
    else {
    $("#searchresult").html("");
    }
    }
    }
    $('#inp_debug').html(c);
    },200);

    $("#search").keyup(
    function () {
    c = 0;
    }
    );

    $(".cms_btn").hover(
    function () {
    $(this).addClass("cms_btn_hover");
    }
    ,
    function () {
    $(this).removeClass("cms_btn_hover");
    }
    );

    $("#clearsearch").click(
    function () {
    c = 99;
    $("#search").val("");
    $("#search").focus();
    $("#searchresult").html("");
    }
    );

    function CheckBoxes() {
    sum = 0;
    c = 1;
    if ($("#sname").attr('checked')) sum++;
    if ($("#ssoc").attr('checked')) sum++;
    if ($("#sacc").attr('checked')) sum++;
    if (sum == 0) {
    //$('#ssoc').attr('checked','checked');
    }
    }

    $("#sname").change(
    function () {
    // if (!($("$sname").attr('checked'))) {
    CheckBoxes();
    // }
    }
    );

    $("#ssoc").change(
    function () {
    // if (!($("#ssoc").attr('checked'))) {
    CheckBoxes();
    // }
    }
    );

    $("#sacc").change(
    function () {
    // if (!($("#sacc").attr('checked'))) {
    CheckBoxes();
    // }
    }
    );

    $("#search").focus();
    // $(".input_num").numeric({allow:"+-"});
    // $(".input_num_only").numeric();
    $("#searchresult").live(
    'click', function () {
    // $record_dummy
    }
    );

    $("#btn_reset").click(
    function () {
    if (account_id > 0) {
    var sel;
    var w;

    var url = "<?php echo $BASE_URL . "inside/accountinfo_with_name.php?id="; ?>" + account_id;
    var title = "Konto " + account_id;

    newwin = "Konto " + account_id;
    window.open (url, '',"status=1,toolbar=1");
    if (window.focus) {newwin.focus()}
    }
    }
    );

    $("#btn_activate").click(
    function () {
    if (account_id > 0) {
    var sel;
    var w;

    var url = "<?php echo $BASE_URL . "inside/activity_activate.php?id="; ?>" + account_id;
    var title = "Konto " + account_id;

    newwin = "Konto " + account_id;
    window.open (url, '',"status=1,toolbar=1");
    if (window.focus) {newwin.focus()}
    }
    }
    );

    $("#btn_inactivate").click(
    function () {
    if (account_id > 0) {
    var sel;
    var w;

    var url = "<?php echo $BASE_URL . "inside/activity_inactivate.php?id="; ?>" + account_id;
    var title = "Konto " + account_id;

    newwin = "Konto " + account_id;
    window.open (url, '',"status=1,toolbar=1");
    if (window.focus) {newwin.focus()}
    }
    }
    );

    $("#btn_log").click(
    function () {
    if (account_id > 0) {

    var sel;
    var w;

    var url = "<?php echo $BASE_URL . "inside/log.php?id="; ?>" + account_id;
    var title = "Kontolog " + account_id;

    newwin = "Kontolog " + account_id;
    window.open (url, '',"status=1,toolbar=1");
    if (window.focus) {newwin.focus()}
    }
    }
    );

    var logouttimer = null;

    $("#btn_logout").click(
    function () {
    $("#wrap_page").fadeOut(300);
    logouttimer = setTimeout(Logout, 800);
    }
    );

    function Logout() {
    $("#frm_logout").submit();
    };

    $(".record_dummy").live(
    'click', function () {
    //alert("jhj");

    var myElement = $(this);
    var classes = myElement.attr('class').split(/\s+/);

    var found = false;
    var marked = false;

    for(var i = 0; i < classes.length; i++){
    var className = classes[i];
    //alert(parseInt(className));
    if(parseInt(className) + 0 == className){
    found = true;
    account_id = parseInt(className);
    // $(this).addClass("tr_marked");
    // alert("!!!!" + i);
    }
    if(className == 'tr_marked'){
    marked = true;
    }
    }
    if (marked) {
    $(this).removeClass('tr_marked');
    // $(this).removeClass('tr_marked').effect("highlight", {color: '#00bb00'}, 500);
    }
    else {
    $(".record_dummy").removeClass('tr_marked');
    $(this).addClass('tr_marked');
    }
    }
    );

    var censor = true;

    $("#btn_censor").click(
    function () {
    if (censor) {
    censor = false;
    // $("#censor").html("Dölj");
    $(".txt").removeClass("xx");
    }
    else {
    censor = true;
    // $("#censor").html("Visa");
    $(".txt").addClass("xx");
    }
    }
    );

    $('.txt').live (
    {
    mouseenter:
    function()
    {
    if (censor) {
    $(this).removeClass('xx').effect("highlight", {color: '#000000'}, 200);
    //$(this).removeClass('xx');
    //removeClass('tr_marked').effect("highlight", {color: '#00bb00'}, 500);
    }
    },
    mouseleave:
    function()
    {
    if (censor) {
    $(this).addClass('xx');
    }
    }
    }
    );

    // XXX
    // $("#div_newaccount").hide();




    });
    </script>
    GroupAlankit likes this.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,331
    Thanks
    60
    Thanked 526 Times in 513 Posts
    Blog Entries
    4
    That looks like javascript / jquery.

    Why are you posting it in a php forum?
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    New to the CF scene
    Join Date
    May 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    is it? i heard of people that is php but okey

    can i change it?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •