473,473 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

validation for login page with radio button

1 New Member
validation for login page with radio button, if click on super admin radio button,i s

Expand|Select|Wrap|Line Numbers
  1. <td><font color="white">Role</font></td>
  2. <td>
  3.  <input type="radio" id="sa" name="admin"><font color="white">Superadmin</font></input>
  4.  <input type="radio" id="ad" name="admin"><font color="white">Admin</font></input>
  5.  </td>
  6.  </tr>
  7.  <tr>
  8.  <td><font color="white">Login name</font></td>
  9.  <td><input type="text" name="loginname" id="ln"></input></td>
  10.  </tr>
  11.  <tr>
  12.  <td><font color="white">Password</font></td> <td><input type="password" name="password" id="pwd"></input></td>
  13. <td><font color="white">Role</font></td>
  14. <td>
  15.  <input type="radio" id="sa" name="admin"><font color="white">Superadmin</font></input>
  16.  <input type="radio" id="ad" name="admin"><font color="white">Admin</font></input>
  17.  </td>
  18.  </tr>
  19.  <tr>
  20.  <td><font color="white">Login name</font></td>
  21.  <td><input type="text" name="loginname" id="ln"></input></td>
  22.  </tr>
  23.  <tr>
  24.  <td><font color="white">Password</font></td>
  25.  <td><input type="password" name="password" id="pwd"></input></td>
  26.  </tr>
  27.  <tr>
  28.  <td><input type="submit" value="submit" onclick="return valid()" ></input></td>
  29.  </tr>
  30.  </tr>
  31.  <tr>
  32.  <td><input type="submit" value="submit" onclick="return valid()" ></input></td>
  33.  </tr>
May 6 '13 #1
2 2744
gits
5,390 Recognized Expert Moderator Expert
what is your exact issue with the posted code?
May 6 '13 #2
Sherin
77 New Member
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.   <head>
  3.  
  4.   function ValidateForm(form){
  5.   ErrorText= "";
  6.   if ( ( form.gender[0].checked == false ) && ( form.gender[1].checked == false ) ) 
  7.   {
  8.   alert ( "Please choose your Gender: Male or Female" ); 
  9.   return false;
  10.   }
  11.   if (ErrorText= "") { form.submit() }
  12.   }
  13.  
  14.  </head>
  15.   <body>
  16.  <form name="feedback" action="#" method=post>
  17.    Gender: 
  18.      <input type="radio" name="gender" value="Male"> Male
  19.   <input type="radio" name="gender" value="Female"> Female
  20.  
  21.  
  22.     <input type="submit" name="SubmitButton" value="Submit" onClick="ValidateForm(this.form)">
  23.  <input type="reset" value="Reset">
  24.   </form> 
  25.   </body>
  26.   </html>
Jan 1 '21 #3

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

Similar topics

4
by: John | last post by:
Could anyone please help me on this?? I have a php script page, which is basically quiz. Visitors (after login in with their email address) are supposed to answer each question, and when they...
10
by: amit.purohit | last post by:
hi, I have a very strange problem on my login Page. the Page was working fine a few days back, but now does not generate post back events for controls. this login page uses form based...
5
by: John Bonds | last post by:
I'm having a dumb problem I put a few TextBoxes on a page and a few RequiredFieldValidators and a button. For some reason when I click the button, my browser still makes a round trip (postback)...
2
by: harleyman1974 | last post by:
I need to programatically "click" a form button from a c++ or c# application which is found on a page. I need to post data to a page and have it interpret the post as a click occured, but I am...
4
by: Charlie Brookhart | last post by:
I am trying to write a code for a button click event. When the button is clicked, it is supposed to bring up an open file dialog box to allow the user to select the document they which to open....
0
by: Amy | last post by:
I am using ASP.NET. I have 3 web server controls on my page. One is textbox1 with AUTOPOSTBACK = true. The other one is another textbox2 with AUTOPOSTBACK = false. The third item is a save button....
2
by: dunderhead | last post by:
Hello, I am having a problem with function and class syntax. I have one class (MakePanel1) that creates a button and label. The button-click event of the button is linked to a function...
1
by: Scadhasini | last post by:
HI I have a tree functionality in my main page. i am upadating nodes wise. updation will be on another page.if i click on browser back button without saving the updations ,i am loosing my...
0
by: nraji | last post by:
hi, I have designed a web part using VS 2003 (Web control library template). I need to publish that in share point. Its not like drag and drop the things from toolbar. Every thing I need to do in...
1
by: su817200 | last post by:
Dear Friend, I would like to run multiple functions on Button Click eg... <input type="button" value="Update" name="B1" onclick="ReadFileToString() timedRefresh(1500)"></p> It is giving...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.