View Single Post
Old 01-21-2013, 08:55 AM   PM User | #1
varalakshmi
New to the CF scene

 
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
varalakshmi is an unknown quantity at this point
On change event not fired with dynamically loaded data

I am dynamically loading data in the input type text and triggering alert if the value of the text box is changed. But my code does not seem to work. Please provide suggestions.
Code:
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("input").val("value");
});
function valueChanged()
{
alert("value changed");
}
</script>
</head>
<body>

<input type="text" onchange="valueChanged()">
<p>Write something in the input field, and then press enter or click outside the field.</p>

</body>
</html>

Last edited by VIPStephan; 01-21-2013 at 09:49 AM.. Reason: corrected code BB tags
varalakshmi is offline   Reply With Quote