1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need help!!!

Discussion in 'HTML & JavaScript' started by rdlew2008, Mar 12, 2013.

  1. rdlew2008

    rdlew2008 Junior Member

    Joined:
    Mar 28, 2012
    Messages:
    103
    Likes Received:
    19
    Ok...i got a nulled pinterest script its kind of buggy here and there. But im working threw the issues but i cant really figure this one out.

    So this is for when a new member registers and it ask what catergorys they are interested in....they highlight like 4 or 5 topics then a button pops up and they move on to the next one. only problem is when the button pops up and they click it ....it just reloads the page. any help appreciated..


    Code:
    <div class="container">      
          <div id="header">
    		  <div id="HeaderContents">
    		    <ol id="Indicators">
    		      <li class="indicator first active">
    		        
    		          <span></span><strong><?php echo $this->translate('People');?></strong>
    		        
    		      </li>
    		      <li class="bracket"><img alt="" src="data/images/right_arrow.png"></li>
    		      <li class="indicator second"><span></span>
    		        <strong><?php echo $this->translate('Pinboards')?></strong></li>
    		      <li class="bracket"><img alt="" src="data/images/right_arrow.png"></li>
    		      <li class="indicator third"><span></span>
    		        <strong><?php echo $this->translate('Follow');?></strong></li>
    		    </ol>
    		    <img alt="Pinterest Logo" src="<?php echo $this->site_logo;?>">
    		</div>
    
    
    	</div><!-- #header -->
    
    
    	<form action="" method="post">
           <div id="MainContent">
    			
    			<div class="hide" id="selected_categoryes"></div>
    			
                <div id="ClickPins">
    
    
                    <h1 style="margin: 0 auto 28px; text-align: center; font-weight: 300;"><?php echo $this->translate('Click a few things you like so we can suggest people to follow.');?></h1>
    
    
                    	<?php foreach($this->categories AS $c) { ?>
                        <a title="<?php echo $c['title'];?>" class="pin" href="javascript:void(0);" id="category_<?php echo $c['category_id'];?>">
                            <span class="category"><?php echo $c['title'];?></span>
                            <span class="square">
                                <span class="check">
                                	<img alt="Checkmark" src="data/images/CheckMark.png"></span>
                                <span class="shadow"></span>
                                <span style="background: url(<?php echo $c['thumb'];?>) 0 -1px repeat;" class="image"></span>
                            </span>
                        </a>
                    	<?php } ?>
                    
                    
    
    
                    <div class="clear"></div>
    
    
    				
                    <div style="margin: 30px auto 80px; text-align: center;">
                    	<button class="BigButton BlueButton disabled" disabled="disabled" ><strong><?php echo $this->translate('Pinboards »');?></strong><span></span></button>
                    </div>
    
    
                </div><!-- #ClickPins -->
    
    
        	</div><!-- MainContent -->
        </form>
    
    
        </div>
        
    <?php if($this->error) { ?>
    <script type="text/javascript">
    $(document).ready(function(){
    	!Pins.error('<?php echo $this->translate('Please select at least one category.');?>');
    });
    </script>
    <?php } ?>
    <script type="text/javascript">
    $(document).ready(function(){
    	var contaner = $('#selected_categoryes').empty();
    	$('#ClickPins .pin').click(function(){
    		selected = $('#ClickPins .pin.selected').size();
    		category_id = $(this).attr('id').replace('category_','');
    		if($(this).hasClass('selected')) {
    			$(this).removeClass('selected');
    			contaner.find('input[value='+category_id+']').remove();
    		} else {
    			if(selected < 5) {
    				$(this).addClass('selected');
    				contaner.append('<input type="hidden" name="category_id[]" value="'+category_id+'" />');
    			}
    		}
    		if($('#ClickPins .pin.selected').size() > 0) {
    			$('#ClickPins .BigButton').attr('disabled', false).removeClass('disabled');
    		} else {
    			$('#ClickPins .BigButton').attr('disabled', true).addClass('disabled');
    		}
    		return false;
    	});
    });
    
    
    function selected_categoryes() {
    	var selected_categoryes = 0;
    	var contaner = $('#selected_categoryes').empty();
    	$('#ClickPins .pin').each(function(i){
    		if($(this).hasClass('selected')) {
    			category_id = $(this).attr('id').replace('category_','');
    			contaner.append('<input type="hidden" name="category_id[]" value="'+category_id+'" />');
    		}
    	});
    	
    }
    </script>
    
    
    
     
  2. Ptrick125

    Ptrick125 Regular Member

    Joined:
    Mar 4, 2013
    Messages:
    428
    Likes Received:
    113
    Occupation:
    Going To School
    Location:
    Near Austin, Texas
    Home Page:
    I'm new to coding, so don't exactly take this as 100% accurate, but there were two things that caught my eye. Please correct me if I am wrong :)

    I'm not sure if this affects the script, but you spelled categories as categoreys a few times.

    This also caught my eye:

    <form action="" method="post">

    There's a good chance I'm wrong, but those 2 things were what stuck out to me the most.
     
  3. Vjo7a

    Vjo7a Registered Member

    Joined:
    Dec 30, 2010
    Messages:
    68
    Likes Received:
    13
    Actually, the code for forms should be something like this:
    <form action="somescript.php" method="post">

    For method you have two choices: post and get, the difference is how the information is passed from the form to the processing script.