This is a message.

Forum user: shanemesser

Basic information

Registered Sep 22, 2010
Last login Sep 22, 2010
Forum posts 16
Direct URL http://www.flowplayer.org/forum/users/52504

Latest forum posts

Posts:

Registered:

simple fader/transition

Posted: Oct 23, 2010

I've used nearly all the jQuery tools in the sites that we develop, but the one we use alot, that doesn't exist, is a simple universal fader. There are a dozen of these out there, but it would be nice to have one inside of this toolset (along with a few other things) to make our shop more standardized. The one we currently use in house (like the one onhttp://www.TheCostaRicanCondo.com) is one that should only take a few lines of code, but it would be extremely useful.

Something simple along the lines of

$.fade( transition speed, transition style, transition pause);

Shane Messer
http://www.MadeToOrderWebsites.com

Posts:

Registered:

» » » » » running a jquery function after validation

Posted: Oct 8, 2010

There are probably several ways to resolve this. That being said, I was writing that out more to illustrate (in the most simple way) the behavior of the onSuccess method and how it kind of defies intuition. To me, onSuccess means "once the form is validated" and NOT "once the element is validated." I'm basing this on the fact that we are using the form and not the element as the object attached to the validator.

Posts:

Registered:

» els.length not working

Posted: Oct 8, 2010

Use this instead:



$("#id").validator({ // CODE }).bind("onSuccess", function(e, els)  {

// CHECK FOR ALL VALIDATION
var numSucceeded = els.length,
numExpected = $(this).data('validator').getInputs().length;

// IF ALL VALIDATION HOLDS TRUE
if (numSucceeded === numExpected) { 
//CODE
}

... etc


Posts:

Registered:

» » » running a jquery function after validation

Posted: Oct 8, 2010

Okay. I got this working athttp://www.madetoorderwebsites.com (the intake form). Anyone who wants to use our code is free to take it.

1. The default behavior of the onSuccess is NOT on-ALL-success, so we had a hell of a time trying reversing into it.

2. The procedure below is barbaric, but it illustrates how to get outside the function if you want (of course you could plug into it but we didn't want to on our case).

3. Why in the world an onALLsuccess isn't included is absolutely beyond me.

Anyway, the code is here, in a very simplistic form. Hopefully it helps someone out.

Here is what we did (we were about to abandon the Tools validator over this issue.



// VALIDATION AND CHECKING FOR ON.ALL.SUCCESS

$("#leadbanker_intake_form").validator({ 
  // CODE 
  }).bind("onSuccess", function(e, els)  {
    var numSucceeded = els.length,
    numExpected = $(this).data('validator').getInputs().length;

    // have we successfully validated input?		
    if (numSucceeded === numExpected) {  

    // successfull process here
    allowed_to_post = true;
  }
}); // end of bind(onSuccess)

// CODE THAT RUNS ONLY IF ALL VALIDATION WORKS

$("#leadbanker_intake_form").bind('submit',function() {	
  if ( allowed_to_post ) { // CODE }
}


Posts:

Registered:

els.length not working

Posted: Oct 7, 2010

var FormFieldCount = 7;
if ( els.length != FormFieldCount ) { return false; };

is not working for me. anything after it is not being triggered. I changed the field count to match, but it still isn't working as simple as it looks.

Posts:

Registered:

» running a jquery function after validation

Posted: Oct 7, 2010

Actually, I have it semi-working, but it submits at random times...?



  $("#leadbanker_intake_form").validator({ 
     // validator stuff
		
  }).bind("onSuccess", function(e, els)  {
     // STUFF IN HERE IS BEING CALLED EVEN WHEN 
     // THE FORM ISN'T FULLY VALIDATED YET??
  });


Posts:

Registered:

running a jquery function after validation

Posted: Oct 7, 2010

Can someone point me in the right direction on this. I am using Tools as a validator but wanting to execute the ajax submit function that I have ONLY IF validation passes. I have a working validation script here that works, and an ajax call that works; but I'm having a time trying to figure out how to get them to work together.

How can I do this?


$(document).ready(function() {
	$("#leadbanker_intake_form").validator({ 
	position: 'center right', 
	offset: [0, 0],
	message: '<div><em/></div>'
	});

	// ON VALIDATOR SUCCESS NEED TO PERFORM the new function.  something like this
	// onSuccess: $("#leadbanker_intake_form").submit(function() {}

});


Posts:

Registered:

nested tabs and nested divs all-in-one :: final solution

Posted: Sep 27, 2010

I've been been messing with this for the past 2 hours and finally got it to work. There is NO example that I could find on the internet, and while the solution looks simple, maybe I'm just reatarded in that it took me a couple hours to figure out.

I have a working example at http://www.madetoorderwebsites.com in the real estate toolset.

A few notes:

(1) - history (keeping state when page is refreshed) ONLY works on ONE call. And it can't be the lower set of tabs. In other words, I cannot figure out how to retain state on sub-tabs. Only the upper-level tabs. Thus, without AJAX on sub tabs, you're stuck refreshing the page and going back to the first tab of that set.

(2) - technically, none of the id's are necessary since they aren't being used (except unless you want the named anchors or to run javascript or whatever on them. That being said, for the purposes of this solution, it's not necessary to have the id's. Sometimes I like to see "exactly the minimalist needs to make something work).

Hope this helps...

if ANYONE can come up with a way to retain state on sub-tabs, I'd be most appreciative.


<ul class="tabs level1">
  <li><a href="#main-tab-1">MAIN TAB 1</a></li>
  <li><a href="#main-tab-2">MAIN TAB 2</a></li>
</ul>
 
<div class="panes level1">
 
  <div id="main-tab-1">
  	TAB 1 MAIN CONTENT
 
    <ul class="tabs level2">
      <li><a href="#1-a">tab 1-a</a></li>
      <li><a href="#1-b">tab 1-b</a></li>
    </ul>
 
    <div class="panes level2">
      <div id="1-a">Page 1 - Tab 1</div>
      <div id="1-b">Page 1 - Tab 2</div>
    </div>
 
  </div>
  
  <div id="main-tab-2">
  	TAB 2 MAIN CONTENT

    <ul class="tabs level2">
      <li><a href="#2-a">tab 2-a</a></li>
      <li><a href="#2-b">tab 2-b</a></li>
    </ul>
 
    <div class="panes level2">
      <div id="2-a">Pane 2 - Tab 1</div>
      <div id="2-b">Pane 2 - Tab 2</div>
    </div>

  </div>
</div>

<script>
$(document).ready(function() {
  $("ul.level1").tabs("div.level1 > div", { history: true });
  $("ul.level2").tabs("div.level2 > div");
});
</script>

Posts:

Registered:

my solution

Posted: Sep 23, 2010

I had this PHP script echoing code inside of one of the tabs...

<script type="text/javascript">
$(document).ready(function(){
$('#{$name}').datepicker({ dateFormat: $.datepicker.W3C + date_obj_time, constrainInput: true, currentText: 'Now', changeYear: true, yearRange: '2009:".date("Y")."' });
});
</script>

I removed that javascript and the tabs started working, even with the nested divs.

I posted a working page onhttp://www.madetoorderwebsites.com/site/nashville-web-design (notice I used 4 tabs with the last tab having a full blown customer input) with a HUGE form and nested divs going down 12 levels (stupid I know, but I am using a form generator and thats what it's outputting right now). Another 6am night figuring out a tool.

I also found this link that can help anyone else in the same position:

http://stackoverflow.com/questions/3066539/jquery-flowplayer-tabs-content-inside-div-tags-not-displaying This guy also posted a completely functional page that works using cut/paste and then regressing into your own situation.

Between his and mine, this should fix nearly any issue someone could face getting these tabs to work.

Posts:

Registered:

» » » » Divs within tab content

Posted: Sep 23, 2010

I used the above coding exactly, but it still seems to break down with too many nested divs. I have one that is 3 deep and it's causing the issue again. Incredibly frustrating.

Posts:

Registered:

doesn"t work

Posted: Sep 23, 2010

The panes>div didn't work.

Also, I duplicated that style sheet and all it did was hide everything. the tab tool didn't unhide, let alone rehide anything.

can someone give a top to bottom simplistic example of (1) the HTML (2) the js call and (3) any style sheet. All in a single page that we can copy and paste to get a working example?

Posts:

Registered:

still not working for me

Posted: Sep 23, 2010

Is it possible to get this to work without putting limiting style sheets on the same page?? These seems like such a simple task (putting divs on tabs). I've done everything on this page and I still cannot get sub-divs to work. I have an example athttp://www.madetoorderwebsites.com

Basically the tabs just don't fire and I see all the content at once. If I take out the sub-divs, it works fine.

<ul class="tabs">
LINKS HERE

<div class="panes">

<div class="holder">
<div class="sub_class_1">
<div class="sub_class_2">
CONTENT HERE
</div>
</div>
</div>

<div class="holder">
<div class="sub_class_1">
<div class="sub_class_2">
CONTENT HERE
</div>
</div>
</div>

</div>

$("ul.tabs").tabs("div.panes > div");

Posts:

Registered:

» » SOLVED

Posted: Sep 22, 2010

i agree... that being said, I think the demo should include full URL's so that it's truly cut/paste. It was a retarded error on my part.

Posts:

Registered:

solved...

Posted: Sep 22, 2010

ust as an FYI:

The issue is that the script fails if it doesn't find the background image.

I fixed the above script and posted it thttp://www.smartcookieky.com/tooltip2.php (PS, I only messed with yours because I was losing my mind and thought what the hell and put another script on another server and it still didn't work).

background-image:url(/tools/img/tooltip/black_arrow.gif);
TO
background-image:urhttp://flowplayer.org/tools/img/tooltip/black_arrow.png);

An hour of my life wasted...

Posts:

Registered:

SOLVED

Posted: Sep 22, 2010

Just as an FYI:

The issue is that the script fails if it doesn't find the background image.

I fixed the above script and posted it tohttp://www.smartcookieky.com/tooltip2.php (PS, I only messed with yours because I was losing my mind and thought what the hell and put another script on another server and it still didn't work).

background-image:url(/tools/img/tooltip/black_arrow.gif);
TO
background-image:urlhttp://flowplayer.org/tools/img/tooltip/black_arrow.png);

An hour of my life wasted...