<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"></script>
<script>
$('#form_131 > input[type=submit]').click(function(){
alert('Jquery alert');
});
</script>
<script type="text/javascript" charset='utf-8'>
function testrun()
{
alert('Test run javascript');
}
</script>
</head>
<body>
<form id="form_131">
<input type="text">
<input type="submit" onclick="testrun()">
</form>
</body>
</html>
I have a code something like this. I dont have the control on the onclick event of the submit button because it is autogenerated on server side by CMS. I need to add click event for the box and add some validation to text. How can I do that.
two things you can do:
call your validation function from
testrun:or put ready function: