onclick change the value of the text box
onclick change the value of the text box
Hi guys;
I use the code below to add or subtract the value of the text box of
number of nights
in this link:
http://www.hotels2go.com.au/gallery_nd2.php?order=3&search_term=Gold+Coast&search_type=destination&search_id=18&id=53&altFormat=2013-05-03&checkin_term=3+May%2C+2013&nights=1&nights=1&nights=1&room_type=12&room_type_view=1+bedroom+apartment
This is my code and it doesnt work. It does call the funciton properly but doesnt update! Any ideas?
Thank you
$(document).ready(function()
{
$(function()
{
$(".nights_minus").click(function()
{
var currentVal = parseInt($(this).next(".nights_text_box").val());
if (currentVal != NaN)
{
$(this).next(".nights_text_box").val( Math.max(1,currentVal - 1) );
}
});
$(".nights_plus").click(function()
{
var currentVal = parseInt($(this).prev(".nights_text_box").val());
if (currentVal != NaN)
{
$(this).prev(".nights_text_box").val(currentVal + 1);
}
});
});
});
Topic Participants
pmdg3
peter.aganyo