Change
$(function(){
//code
});
to
jQuery(function($){
//code
});
to avoid conflicts with the '$' variable, assuming the jquery file is
being loaded correctly. Are you using other libraries in the same
page? If not, you probably got the wrong src path for the script.
- ricardo
On Apr 22, 9:48 am, jjsanders <[email protected]> wrote:
> Hello,
>
> I have a selectbox with month periods in it.
>
> Here is my code:
>
> $(function(){
>
> $("#ppsub_ppterm_id").change(function(){
> var term =
> this.options[this.selectedIndex].text;
>
> if(term == "Eenmalig"){
> $(".idealtd").show();
> }else{
> $(".idealtd").hide();
> //$("#ppsub_amount
> option:selected").val('anders');
> }
> });
>
> });
>
> <select name="ppsub_ppterm_id" class="ppsub_ppterm_id"
> id="ppsub_ppterm_id" style="width: 100px; font-size: 11px;">
> <option
> value="M">Maand</option>
> <option
> value="K">Kwartaal</option>
> <option
> value="H">Halfjaar</option>
> <option
> value="J">Jaar</option>
> <option selected
> value="E">Eenmalig</option>
> </select>
>
> But when i load my page i staight away get an error:
>
> $("#ppsub_ppterm_id") is null
> Line 17
>
> any idea's?