Home › Forums › Quform WordPress › Using text input to change drop down values
- This topic has 2 replies, 2 voices, and was last updated 8 years, 2 months ago by Leodore.
- AuthorPosts
- February 24, 2016 at 4:32 am #18270LeodoreParticipant
Hi Ally,
I am wanting to try and use a text input to create some conditional logic.
What I would like is for the user to type a number into a text field and then that value dynamically changes a value in a drop down list (these drop down values can be used for conditional logic)I tried the following code in an html element after reading a whole bunch of other posts and trying to put all the logic together but I am definitely no coder and surprise, surprise it doesn’t work.
` <script>
jQuery(document).ready(function ($) {
$(“.iphorm_1_4”).on(‘keyup’,function(){
$numberSelect = $(‘.iphorm_1_5’)
if ($(this).val() >= 10000000) {
$numberSelect.val(‘More than 10 million’).change();
}
else if ($(this).val() > 1) {
$numberSelect.val(‘More than 1’).change();
}
else if ($(this).val() = 1)) {
$numberSelect.val(‘1’).change();
}
else if ($(this).val() < 1)) {
$numberSelect.val(‘Less than 1’).change();
}
else {
$numberSelect.val(‘Unknown’).change();
}
});
});
</script> `
Any help would be greatly appreciatedFebruary 24, 2016 at 8:18 pm #18274AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
February 25, 2016 at 4:10 am #18278LeodoreParticipantThank you so Much Ally! It works perfectly. The customer support in this Forum is incredible! I am blown away by how awesome you are 🙂
- AuthorPosts
- You must be logged in to reply to this topic.