/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] problem with two js on one page

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>

[/code]

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.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FangDec 14.2009 — Try using the jQuery.noConflict
Copy linkTweet thisAlerts:
@luntarauthorDec 14.2009 — Try using the jQuery.noConflict[/QUOTE]

Thnx for reply,

I have read about that before but I don't really know how to use it ;/

I tried to replace $ with jQuery.noConflict but without any results

L.
Copy linkTweet thisAlerts:
@luntarauthorDec 14.2009 — okie dokie

I finally managed to make it work,

Of course jQuery.noConflict()...

this solved the problem :
<i>
</i>jQuery(document).ready(function($)



Again, thnx for help

L.
×

Success!

Help @luntar spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...