Hide fields according to numbers 11,12,13 Other than that it shows all

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
saleh
User
Posts: 470

Hide fields according to numbers 11,12,13 Other than that it shows all

Post by saleh »

Hello
Hide fields according to numbers 11,12,13 Other than that it shows all

$(document).ready(function(){
$$("#r_Video").show();
$("#r_Video2").show();
$("#r_pdf").show();
//Hide fields according to numbers 11,12,13 Other than that it shows all
$("#x_Competitions_name").change(function() {
var str = $("option:selected", this);
if (this.value == "10") {
("#r_Video").hide();
$("#r_Video2").hide();
$("#r_pdf").hide()
} else if (this.value == "11") {
$("#r_Video").hide();
$("#r_Video2").hide();
$("#r_pdf").hide();
} else if (this.value == "12") {
$("#r_Video").hide();
$("#r_Video2").hide();
$("#r_pdf").hide();
} else {
$("#r_Video").show();
$("#r_Video2").show();
$("#r_pdf").show();
}

});
});


saleh
User
Posts: 470

Post by saleh »

Sorry, he got the numbers wrong :
Hide fields according to numbers 10,11,12 Other than that it shows all

$(document).ready(function(){
$$("#r_Video").show();
$("#r_Video2").show();
$("#r_pdf").show();
//Hide fields according to numbers 11,12,13 Other than that it shows all
$("#x_Competitions_name").change(function() {
var str = $("option:selected", this);
if (this.value == "10") {
("#r_Video").hide();
$("#r_Video2").hide();
$("#r_pdf").hide()
} else if (this.value == "11") {
$("#r_Video").hide();
$("#r_Video2").hide();
$("#r_pdf").hide();
} else if (this.value == "12") {
$("#r_Video").hide();
$("#r_Video2").hide();
$("#r_pdf").hide();
} else {
$("#r_Video").show();
$("#r_Video2").show();
$("#r_pdf").show();
}

});
});

What is correct in writing the code because it did not work for me .. I think my idea reached you ... Use Google for translation I apologize for the mistakes


mobhar
User
Posts: 11727

Post by mobhar »

saleh wrote:

("#r_Video").hide();

It should be:

$("#r_Video").hide();

saleh
User
Posts: 470

Post by saleh »

Thank you successfully working


Post Reply