Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 10-07-2007, 06:34 PM Validation problems
stoot98's Avatar
Ultra Talker

Posts: 427
Name: Stuart
Location: Glasgow, Scotland
Trades: 0
Hi guys

Ive inserted the Yav validation script into a form of mine and Im having a couple of problems. The actual validation works great and an alert pops up telling me what is wrong but once i click OK it submits the form anyway, even though it isnt right.

Ive attached the Yav script in case you want to have a look although i would presume it isnt something thats wrong in there.

The rules script section is:

Code:
    <SCRIPT>
	    var rules=new Array();
	    rules[0]='supplyMusic.[track]|required|You must select an option to supply your music';
	    rules[1]='supplyTrack.[track]|required|You must select an option to supply a reference track';
	</SCRIPT>
and my form header code is:

Code:
	<form name="myForm" method="POST" onsubmit="return performCheck('myForm', rules, 'classic');" action="page.php" enctype="multipart/form-data">

Any help on this would be grand!
Cheers
Stoot
Attached Files
File Type: txt yav.txt (32.7 KB, 1 views)
File Type: txt yav-config.txt (2.5 KB, 1 views)
stoot98 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-07-2007, 08:11 PM Re: Validation problems
logic ali's Avatar
Super Talker

Posts: 104
Trades: 0
Quote:
Originally Posted by stoot98 View Post
Hi guys

Ive inserted the Yav validation script into a form of mine and Im having a couple of problems. The actual validation works great and an alert pops up telling me what is wrong but once i click OK it submits the form anyway, even though it isnt right.
Please post a link to a runnable demo.
logic ali is offline
Reply With Quote
View Public Profile
 
Old 10-08-2007, 11:59 AM Re: Validation problems
stoot98's Avatar
Ultra Talker

Posts: 427
Name: Stuart
Location: Glasgow, Scotland
Trades: 0
ok, ive just went on the site to get the link and happen to be using FireFox cos im at uni and the problem does not seem to be happening. I also just checked it in Konquerer and it is still happening, so this makes it a little more confusing.

I was originally using IE 7 and would like to get it fixed on this browser.

Link is:

http://www.online-md.co.uk/index.php?pageID=22

Cheers
stoot98 is offline
Reply With Quote
View Public Profile
 
Old 10-08-2007, 12:47 PM Re: Validation problems
logic ali's Avatar
Super Talker

Posts: 104
Trades: 0
Quote:
Originally Posted by stoot98 View Post
First get rid of javascript: in the onsubmit handler, you don't ever need to write that in a script.

Your submit button is trying to call an entirely different function on click.

Use the error console.
logic ali is offline
Reply With Quote
View Public Profile
 
Old 10-08-2007, 02:14 PM Re: Validation problems
stoot98's Avatar
Ultra Talker

Posts: 427
Name: Stuart
Location: Glasgow, Scotland
Trades: 0
Ive taken out those things you mentioned and the same thing is happening. In IE7 (and safari it seems too) the errors are displayed but the form still submits.

Any other thoughts would be greatly appreciated!
stoot98 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Validation problems
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.59475 seconds with 13 queries