How to attach .js file dynamically using ajax?

light

New member
I have an ajax function that calls a .php file that lists the result of a query from the database...I dynamically created input buttons to call a JavaScript function on onSubmit event, like so:

<script type='text/javascript' src='validateData.js'></script>
<form action='HRapproveManreq.php' name='app' method='post' onSubmit='return validate();'>
<input type='hidden' value='".$row['id']."' name='txtHidden' style='position:absolute;'/>
<input type='submit' value='Tag as Approved' />
</form>

The function validate() (included in the validateData.js) should be called when the button is clicked,but it doesn't work... since this was loaded using ajax... please help...
 
Back
Top