Buttons based on Validation

This is a discussion on "Buttons based on Validation" within the JavaScript Forum section. This forum, and the thread "Buttons based on Validation are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 29th, 2004, 21:00
New Member
Join Date: Feb 2004
Location: Australia
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Buttons based on Validation

I have a number of buttons on my form which I would like to hide/reveal based on the results of the validation of the fields on the form.

Say one of the required fields on the form is date of birth. Now if the user skips this field or enters the information incorrectly which triggers a validation error I would like to not reveal a new set of buttons.

The code that I have at the moment in JSP is:

Code: Select all
<script type="text/javascript" language="JavaScript">

<!-- 

function setButtonReveal() 

  {

  document.getElementById('B00').style.visibility = "hidden";

  document.getElementById('B01').style.visibility = "visible";

  document.getElementById('B02').style.visibility = "visible";

  document.getElementById('B03').style.visibility = "visible";

  document.getElementById('B04').style.visibility = "visible";

  }

-->

</SCRIPT>

As you can see there is no "if" statement based on a validation passing or failing. I was wondering if there was a way to stop the button reveal code running if the validation failed.

Thanks

Eddie
??:

  #2 (permalink)  
Old Feb 29th, 2004, 22:33
Reputable Member
Join Date: Jan 2004
Location: United Kingdom
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there

Welcome to the Forums...!

I would suggest you posting this thread in the Javascript section as you are more likely to receive a greater response in there.

Sarah x
  #3 (permalink)  
Old Mar 1st, 2004, 00:00
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
[moved]
  #4 (permalink)  
Old Mar 1st, 2004, 01:00
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
There's a couple ways to do it. Could you give a more detailed example? Do you already have the validation code you're going to use?
Closed Thread

Tags
buttons, based, validation

« .js file | asterix »
Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me test my PHP-based CMS tox0tes Webforumz Cafe 5 Sep 1st, 2007 03:02
CSS based on browser ? Accurax Web Page Design 3 Jun 15th, 2007 13:33
can't convert table-based to css-based layout markus Web Page Design 21 Apr 25th, 2007 22:50
help with fwd/backwrd buttons affecting other buttons typeofdoug Flash & Multimedia Forum 5 Feb 4th, 2007 03:48
Validation problem with multiple submit buttons celia05es JavaScript Forum 2 Sep 29th, 2005 08:19


All times are GMT. The time now is 04:27.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43