Paul,

You need to "trigger" the change method when you initialize your code:

On Thu, Nov 12, 2009 at 11:07 AM, Paul Ihrig <pih...@gmail.com> wrote:

>
> <script>
>        $(function(){
>                $("#prt_type").change(function () {
>                        var val = $(this).val();
>                        switch(parseInt(val)){
>                        case 6:
>                                $("#prt_prog_1").show();
>                                break;
>                        case 1: case 2: case 3: case 4: case 5: case 7: case
> 8:  case '':
>                                $("#prt_prog_1").hide();
>                                break;
>                        }
>                });
>        });
> </script>
>
>
Change the above code to:

<script>
       $(function(){
               $("#prt_type").change(function () {
                       var val = $(this).val();
                       switch(parseInt(val)){
                       case 6:
                               $("#prt_prog_1").show();
                               break;
                       case 1: case 2: case 3: case 4: case 5: case 7: case
8:  case '':
                               $("#prt_prog_1").hide();
                               break;
                       }
               }).trigger("change");
       });
</script>

That will force jQuery to fire the change event handler, just as if the
browser actually fired the event.

-Dan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328304
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to