473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem getting function to return false

11 New Member
I have 2 functions, the first one, "GetSelectedIte m" is determining which radio button was selected and running the "formvalidation " function if needed. This is working fine. My problem is getting the entire form to return false if "formvalidation " is false. I can't figure out how to have "GetSelectedIte m" return false if "formvalidation " is false. I've tried a bunch of methods I've found, but I keep getting it wrong.

Any help would be greatly appreciated! Here is what I have:


<script language="JavaS cript" type="text/JavaScript"><!--

function GetSelectedItem () {
chosen = ""
len = document.form.i tem_LabelShip.l ength
for (i = 0; i <len; i++) {
if (document.form. item_LabelShip[i].checked) {
chosen = document.form.i tem_LabelShip[i].id
}
}
if (chosen == "ExpressShi p") {formvalidation (this)}
}



function formvalidation( )
{
with (document.form. ShipperAcctNumb er)
{
if (value == null || value == "")
{alert("For overnight FedEx/DHL shipping, you must enter an account number.");retur n false}
else {return true}
}
}


//--></script><form name="form" onsubmit="retur n GetSelectedItem ()" action="http://www.cartserver. com/sc/cart.cgi" method="post">
Apr 30 '07 #1
2 1699
iam_clint
1,208 Recognized Expert Top Contributor
if (chosen == "ExpressShi p") {formvalidation (this)}

if (chosen == "ExpressShi p") { return formvalidation( this); }
Apr 30 '07 #2
FunkHouse9
11 New Member
Clint, you are my new hero!!! Thank you!
May 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1945
by: Dwayne Epps | last post by:
This is probably a no brainer, but I am having no luck at getting this to work. I'm creating functions that will validate form data fields. For example, the following function: function checkText(field, msg, min, max) { if (!min) { min = 1 } if (!max) { max = 65535 } if (!field.value || field.value.length < min || field.value.max > max...
1
7294
by: Michael J Whitmore | last post by:
I am getting tired of losing hair over this. Here is a function that simply inserts one of three images into a document right before printing. It is called for every element that has a specific id in the document with the onbeforeprint window call. The chosen image will then be inserted into the document as a child element of ‘fig'. The...
10
19121
by: Mark Jerde | last post by:
I'm trying to learn the very basics of using an unmanaged C++ DLL from C#. This morning I thought I was getting somewhere, successfully getting back the correct answers to a C++ " int SumArray(int ray, int count)" Now I'm having problems with C++ "return(false)" being True in C#. Here is the C# code. ========================= using...
16
1724
by: shapper | last post by:
Hello, I have a generic list as follows: Dim rows As New Generic.List(Of row) Now I have a row: Dim myRow As row I tried to check, further in my code, if the row is nothing: If myRow Is Nothing Then
1
3177
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as follows: The code below is for the first page:session_start is in line 3 <link href="css/jobSheet.css" rel="stylesheet" type="text/css" /> ...
1
3785
by: rsteph | last post by:
I bought a book to help me learn to use DirectX with windows programming. It's first trying to walk me through some basic windows programming and graphics before getting into DirectX. I'm trying to expand on one of the example programs in the book but I'm having some problems. I can get a frame to appear, then an image gets randomly placed in...
0
2348
by: jiwas78 | last post by:
Hey there. I am learning XML and Actionscript. I have a problem with getting my XML data to load when my SWF is in an HTML page in a browser. When I open the SWF on it's own whether in Flash Player or browser, my playlist of songs comes up. But in the HTML page it's a no go. Here is what my XML looks like: <?xml version="1.0" ?> <playlist>...
0
2229
by: jiwas78 | last post by:
Hey there. I am learning XML and Actionscript. I have a problem with getting my XML data to load when my SWF is in an HTML page in a browser. When I open the SWF on it's own whether in Flash Player or browser, my playlist of songs comes up. But in the HTML page it's a no go. Here is what my XML looks like: <?xml version="1.0" ?> <playlist>...
2
3137
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error message as in alert box as " Internet Explorer cannot open the Internet site http://google.citycarrentals.com.au/viewalllocations.php . Operation...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.