CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Control validations

Print topic Send  topic

Author Message
mljonzs

Posts: 124
Posted: 03/28/2007, 8:40 AM

Hello, It's me again. I'm having difficulties in my ASP Code Charge application in doing some data validations.

I have a radio Button control on my page. When user clicks the submit button (to insert or update) I need to make sure that they selected something for this control - no default value is set so on a new record nothing is selected yet. I have a javascript file that I use for various control validations, but I can't seem to figure out how to check that something was picked (and which selection was picked) for the radio button.

Here is the basic format I use to check for a value in a TextBox control, but similiar logic does not work for the RadioButton.

function ValidateForm() {  
	var en = document.getElementById("en").value;  
  
	if (en.length == 0) {  
		alert("End-User Name is required for starting a New Profile!");  
		return false;  
	}  
  
        return true;  
} // end ValidateForm  

Any suggestions?
Thanks, Michelle
_________________
What does not begin WITH God, will end in failure!
View profile  Send private message
knoops


Posts: 23
Posted: 03/29/2007, 4:08 AM

Why not simply set the Required-property for the RadioButton? Or use the Validation Rule to '#' (or whatever the correct syntax is...) so that it checks for a numeric value (0/1) on submit...
View profile  Send private message
micjon

Posts: 8
Posted: 03/29/2007, 7:51 AM

The end-users do not like the way Code Charge handles things when I use the Required property or validation so I have interceeded it with my own javascript to display a warning box with information. It works well but like I originally stated, I am not picking up the radio button correctly.....
View profile  Send private message
knoops


Posts: 23
Posted: 03/29/2007, 8:38 AM

With JavaScript the element.checked (or was is element.selected?) is to be tested for a true or false value when using checkboxes, lists or radioboxes. The element.value is only valid for textboxes. Google for "javascript reference" and see what properties are available.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.