/    Sign up×
Community /Pin to ProfileBookmark

jquery scripts don’t work together

Hi all! I’m putting together a form (it’s really basic right now but functions the way I want). Part of the form uses jquery to break it up into an accordion. I want to add a certain kind of jquery validation to it as well, but right now the scripts I have for the accordion menu and the validation don’t work together. The whole thing just breaks. Any idea why? Do you think there’s a way I can get them to work together?

Here’s the menu I’ve been working on:
[url]http://www.maintenance-business.com/[/url]

Here’s the validation I want to use:
[url]http://www.willjessup.com/sandbox/jquery/form_validator/form_validate.html[/url]

Thanks for any suggestions you can offer.

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@KDLAMar 27.2008 — It's hard to tell with the separate pages. BUT, I would guess that you need to name/id your forms (menu and actual form) and specify to the javascript which form by name/id it needs to validate.

KDLA
Copy linkTweet thisAlerts:
@jessnoonyesauthorMar 27.2008 — Thanks for your reply! Actually I should have been more specific in the problem. The problem is the accordion menu runs off a file called jquery.js and the validation off a file called jquery2.js. Both work fine independently of eachother. But if I so much as put the link into the accordion page:

<script type="text/javascript" src="jquery.js"></script>

which calls the script for validation the accordion stops working.
Copy linkTweet thisAlerts:
@KDLAMar 27.2008 — Yes, that's what I understood. I believe the problem occurs because the two scripts you have created each reference an unnamed form in the document. Because of this, the script does not know which form in which to perform the function. If you applied a name/ID to each form, then put those references in the javascripting, the action would have a clear point of reference.
Copy linkTweet thisAlerts:
@jessnoonyesauthorMar 27.2008 — Gotcha, OK thanks!
Copy linkTweet thisAlerts:
@jessnoonyesauthorMar 27.2008 — Ok I abandoned that particular validation script. I'm using something now that works well, but I have a quick question. If you look under "title 1" at:

http://www.maintenance-business.com

There's a check box that, when checked, says "thank you" and the value is passed to the right. How do I add a couple more check boxes that if checked return an error message? This is the code for the current check box:

<input type="checkbox" id="f18" value="1" class="checkbox"

onChange="document.getElementById('one').value='One';" />

<script type="text/javascript">

var f18 = new LiveValidation('f18');

f18.add(Validate.Acceptance );

</script>
Copy linkTweet thisAlerts:
@KDLAMar 27.2008 — I'm not really sure what you're trying to achieve. It doesn't work in IE7 -- if you click on the box, then click another title, then return to "Title 1," the checkbox is still checked but the text next to it is missing.

You might take a look at this: http://javascript.internet.com/miscellaneous/content-display.html

It is a much easier version of what you're trying to do. You can make the content appear ("showbox()") onclick of the checkbox.
×

Success!

Help @jessnoonyes 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.19,
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,
)...