I have a few users which I want to divide into 2 (or more) poule.
I can drag and drop these users with the plugin sortible-list but how can I make the change in the mysql database when a user is released in a poule? So when eg user Arie Thuis was released in poule 1, the record of Arie Thuis must have updated the number '1' in the column poule.
I have a user table with a column poule and a poule table with the ID of the poule.
When you click on the tab "Onderdelen" and then on the button "Selecteer", you get a popup where you can (un)check some checkboxes. After submitting with "Onderdelen selecteren" I have got it working that the page will refresh so the new data will be effected. But after the refrsh I go default to tab no. 1 .........
How can I change this that after the refresh I go directly to tab no. 2?
The javascript of the slider is :
$(function() { /* number of fieldsets */ var fieldsetCount = $('#formElem').children().length;
/* current position of fieldset / navigation link */ var current = 1;
/* sum and save the widths of each one of the fieldsets set the final sum as the total width of the steps element */ var stepsWidth = 0; var widths = new Array(); $('#steps .step').each(function(i){ var $step = $(this); widths[i] = stepsWidth; stepsWidth += $step.width(); }); $('#steps').width(stepsWidth);
/* to avoid problems in IE, focus the first input of the form */ $('#formElem').children(':first').find(':input:first').focus();
/* show the navigation bar */ $('#navigation').show();
/* when clicking on a navigation link the form slides to the corresponding fieldset */ $('#navigation a').bind('click',function(e){ var $this = $(this); var prev = current; $this.closest('ul').find('li').removeClass('selected'); $this.parent().addClass('selected'); /* we store the position of the link in the current variable */ current = $this.parent().index() + 1; /* animate / slide to the next or to the corresponding fieldset. The order of the links in the navigation is the order of the fieldsets. Also, after sliding, we trigger the focus on the first input element of the new fieldset If we clicked on the last link (confirmation), then we validate all the fieldsets, otherwise we validate the previous one before the form slided */ $('#steps').stop().animate({ marginLeft: '-' + widths[current-1] + 'px' },500,function(){ if(current == fieldsetCount) validateSteps(); else validateStep(prev); $('#formElem').children(':nth-child('+ parseInt(current) +')').find(':input:first').focus(); }); e.preventDefault(); });
/* clicking on the tab (on the last input of each fieldset), makes the form slide to the next step */ $('#formElem > fieldset').each(function(){ var $fieldset = $(this); $fieldset.children(':last').find(':input').keydown(function(e){ if (e.which == 9){ $('#navigation li:nth-child(' + (parseInt(current)+1) + ') a').click(); /* force the blur for validation */ $(this).blur(); e.preventDefault(); } }); });
/* validates errors on all the fieldsets records if the Form has errors in $('#formElem').data() */ function validateSteps(){ var FormErrors = false; for(var i = 1; i < fieldsetCount; ++i){ var error = validateStep(i); if(error == -1) FormErrors = true; } $('#formElem').data('errors',FormErrors); }
/* validates one fieldset and returns -1 if errors found, or 1 if not */ function validateStep(step){ if(step == fieldsetCount) return;
var error = 1; var hasError = false; // $('#formElem').children(':nth-child('+ parseInt(step) +')').find(':input:not(button)').each(function(){ $('#formElem').children(':nth-child('+ parseInt(step) +')').find(':input.required:not(button)').each(function(){
var $this = $(this); var valueLength = jQuery.trim($this.val()).length;
/* if there are errors don't allow the user to submit */ $('#registerButton').bind('click',function(){ if($('#formElem').data('errors')){ alert('Vul in elke tab de juiste gegevens in voordat u het nieuwe toernooi kunt aanmaken'); return false; } }); });
function refresh_tabel() { location.href='http://www.familiekant.nl/toernooimaker/club/toernooi-aanmaken-nieuw3.php?'; }
function submitToHighslide(form) {
// identify the submit button to start the animation from var anchor; for (var i = 0; i < form.elements.length; i++) { if (form.elements[i].type == 'submit') { anchor = form.elements[i]; break; } } // open an expander and submit our form when the iframe is ready hs.overrides.push('onAfterExpand'); hs.htmlExpand(anchor, { objectType: 'iframe', src: 'about:blank', width: 800, height: 600, onAfterExpand: function(expander) { form.target = expander.iframe.name; form.submit(); } }); // return false to delay the sumbit until the iframe is ready return false; } </script>
Is there a way to change the javascript of the slider so that I can choose which tab must be opened when I do the refresh?
I think that another solution can be with AJAX but I haven't got any clue how to get this done .....
Hopefully anyone can get me any further with this.