Hi,
I have read all threads regarding 2 js on a page but couldn’t find working solution for me.
Before I begin I must admit I am total JS newbie…
I got 2 JS’s from the internet, one is for form validation and one is for files upload,
They are working just fine – alone… but whenever I wont to put them together file upload is not working at all, I run debugger and see no error…
here is what I have :
[code]
<script type=”text/javascript”>
jQuery(document).ready(function()
{
var button = $(‘#button1’), interval;
new AjaxUpload(button,
{
action: ‘inc/upload.php’,
name: ‘myfile’,
onSubmit : function(file, ext)
{
button.text(‘Uploading’);
this.disable();
interval = window.setInterval(function()
{
var text = button.text();
if (text.length < 15)
{button.text(text + ‘.’);}
else
{button.text(‘Uploading’);}
}
, 200);
}
,onComplete: function(file, response)
{
button.text(‘Add files’);
window.clearInterval(interval);
this.enable();
$(‘<li></li>’).appendTo(‘#example1 .files’).text(file);
}
});
});
</script>
<script type=”text/javascript”>
window.addEvent(“domready”, function() {
var exValidatorA = new fValidator(“exA”);
}); </script>
</head>
<form id=”exA” class=”fValidator-form” enctype=”multipart/form-data” action=”index.php” method=”post”>
<table>
<tr><td><textarea id=”exA_textarea2″ class=”fValidate[‘required’]” name=”textarea2″ cols=”100″ rows=”8″></textarea></td></tr>
</table>
<ul>
<li id=”example1″ class=”example”>
<div class=”wrapper”>
<div id=”button1″ class=”button”>Add file</div>
</div>
<p>Files:</p>
<ol class=”files”></ol>
</li>
</ul>
<br>
<textarea name=”textarea3″ cols=”100″ rows=”10″></textarea>
<p align=”center”><input type=”Submit” value=”Send” name=”Submit”></p>
<br>
</form>
So, I tried to add OnLoad=”” to Body section but it didn’t work…
Im kinda out of ideas how this can work at once
L.