Ask a Question related to ASP.NET General, Design and Development.
-
jayuya #1
Radio Button List server control and java script
How can i check in java script if a asp.net radio button
list server control is selected?
I have some custom javascript function in the client side
that needs to run but I don't see the way to see if user
selected or not one of the options....
thanks,
jayuya
jayuya Guest
-
Radio Button & List to search - ASP
Hi Guys, Can someone point me to a tutorial for DW 8 or advise me on how to do this. I want to search a database using 2 radio buttons and a... -
How to put a full radio button list in each row of datagrid?
Hello, I have a datagrid where I display images. I want visitors to be able to rate the images on a scale of 1 to 10 by clicking a radio button,... -
radio button list doesn't hold value?
Hi. I have a radio button list with list items assigned via a datareader from a database. Everything looks fine, the items are there on page load,... -
Programmatically Selecting Item in Radio Button List
I have created a radio button list programmatically. C# SqlConnection conn = new SqlConnection("data source=localhost; integrated security=true;... -
java script and server texbox control
I got it with(document.forms){ if(!RFV_FrameSelection.IsValid){//validator is false //code... return; } } -
David Waz... #2
Radio Button List server control and java script
The aspx control obviously renders as normal HTML. Use
the ID/Name of the html control as usual.
An easy way to get the HTML name:
htmlName=replace(RadioButtonControl.UniqueName,":" ,"_")
>-----Original Message-----
>How can i check in java script if a asp.net radio button
>list server control is selected?
>
>I have some custom javascript function in the client side
>that needs to run but I don't see the way to see if user
>selected or not one of the options....
>
>thanks,
>jayuya
>.David Waz... Guest
-
Vidar Petursson #3
Re: Radio Button List server control and java script
Hi
Example ( Should work... I did not check :) )
Replace FORMNAME/RADIONAME with yours
<html>
<head>
<script language="JavaScript">
function checkRadio(){
var bIsChecked = false;
var r = document.forms["myForm"].r1;
for(i=0;i<r.length;i++)
{
if( r[i].checked )
{
bIsChecked = true;
break;
}
}
if(!bIsChecked ) alert("Please check.... ");
return bIsChecked;
}
</script>
</head>
<body>
<form name="myForm">
<input type="radio" name="r1">
<input type="radio" name="r1">
<input type="radio" name="r1">
<input type="radio" name="r1">
<input type="radio" name="r1">
<input type="submit" onclick="return checkRadio()" value="Click to test
radio">
</form>
</body>
</html>
Note if for some reason the list has only 1 item the length will be
undefined.
And also we have a good group for client issues
microsoft.public.scripting.jscript
--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
"jayuya" <jayuya@cox.net> wrote in message
news:03c501c34195$51b31810$a101280a@phx.gbl...> How can i check in java script if a asp.net radio button
> list server control is selected?
>
> I have some custom javascript function in the client side
> that needs to run but I don't see the way to see if user
> selected or not one of the options....
>
> thanks,
> jayuya
Vidar Petursson Guest



Reply With Quote

