Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-08-2004, 08:07 PM
WebProWorld Member
 

Join Date: Jan 2004
Location: NorCal
Posts: 64
MasterT RepRank 0
Default Form validation

i want to validate this form in this way

i have a select for them to select their contact preference one of them is Fax and i dont have a fax number required to be typed in

i want to to be required if they select fax how do i do this ?


this is what i have so far

Code:
function fax(formField,fieldLabel,required)
{	
	var result = true;
	if(!result) 
	{	
   alert("You have selected Fax as your contact preference please type in your fax number"); 
	

{
	return result;
}
i know no javascript this is all just stuff i copied and threw together

please help
__________________
http://mxtracks.us/images/MXTracksLogo.gif
California MX Tracks, Games, Photos, whatever you want its here
Reply With Quote
  #2 (permalink)  
Old 03-12-2004, 08:21 PM
httpman's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: France
Posts: 196
httpman RepRank 0
Default

Hi,

I try to answer : in a form, each element (radio button, input box, check boxes etc.) should have a name, which you tell via the 'name=xxxx' parameter within the HTML tag.

Now, once your tag has a name, you can address it via JavaScript, and then read its content and then verify it before sending the form on the web.

The bad new is that this check requires a few javascript code, hence if you don't know javascript it's hard to explain !...

Could sound like "MI-2" or more !!

JP
__________________
www.net-createurs.com [ french only website sorry ! ]
Reply With Quote
  #3 (permalink)  
Old 03-13-2004, 10:56 AM
WebProWorld Veteran
 

Join Date: Feb 2004
Location: Lodz, Poland
Posts: 329
adore RepRank 0
Default

And users must have Java enabled in their browsers as well.
__________________
http://www.twojecentrum.pl - Polish e-shopping center
http://dzwonki-loga.pl - Ringtones for mobile phones
Reply With Quote
  #4 (permalink)  
Old 03-13-2004, 03:28 PM
WebProWorld Member
 

Join Date: Jan 2004
Location: NorCal
Posts: 64
MasterT RepRank 0
Default

I figured it out guys
__________________
http://mxtracks.us/images/MXTracksLogo.gif
California MX Tracks, Games, Photos, whatever you want its here
Reply With Quote
  #5 (permalink)  
Old 03-20-2004, 11:37 AM
LjN's Avatar
LjN LjN is offline
WebProWorld New Member
 

Join Date: Mar 2004
Location: Notts, UK
Posts: 12
LjN RepRank 0
Default

Quote:
I figured it out guys
would you be willing to share it... i'm in need of something similar

Thanks!
__________________
Always learning....
~~~~~~~~~~~~~~~~~~~~
http://www.cn-electrical.co.uk
Site reviews always welcome!
Reviews are always reciprocated
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

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

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


Search Engine Optimization by vBSEO 3.2.0