Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8756015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:58:16+00:00 2026-06-13T13:58:16+00:00

i’m trying to write a form in aspx page includes veification in the submit

  • 0

i’m trying to write a form in aspx page includes veification in the submit button.Even if i run debugger clicking the submit doesn’t perfom the Js code (or maybe there is a problem in syntax that i dont’ know what is it). Can anyone help me find the mistake (either synax of script or something in the html)? thanks alot:)
the code of default.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>טופס הרשמה</title>
<link rel="Stylesheet" type="text/javascript" href="style.css" />
<script>
    var FinalMsg = "";
    function VerifyForm() {
        VerUser();
        VerPasses();
        VerGen();
        alert(FinalMsg);
    }        
    function VerUser(){
        var vus = document.getElementById("username").value;
        if(vus.length=0)
        {
            FinalMsg+="type username";
        }
    }
    function VerPasses(){
        var vpasfir = document.getElementById("pass1").value;
        var vpassec = document.getElementById("pass2").value;
        if(vpasfir.length=0)
        {
            FinalMsg+="type password";
        }
        if(vpassec.length=0)
        {
            FinalMsg+="type the secondary pass";
        }
        if (vpasfir.value != vpassec.value) 
        {
            FinalMsg+="passs aren't match";
        }
    }         
    function VerGen() {
        var vgen1 = document.getElementById("male").value;
        var vgen2 = document.getElementById("female").value;
        var vgen3 = document.getElementById("other").value;
        if ((vgen1.checked==false)&&(vgen2.checked==false)&&(vgen3.checked==false&&)){
            FinalMsg += "haven;t chosen gender";
        }
    }

</script>
</head>
<body dir="rtl">
<center>   <img src="Title.gif" width="500px"/></center> 
<form id="FormAboutYou" runat="server" method="post" onsubmit="validateForm()">
<table border="0">
    <tr>
        <td class="field">שם משתמש</td>
        <td><input type="text" name="username" id="username"/></td>
    </tr>
    <tr>
        <td class="field">סיסמה</td>
        <td><input type="password" name="pass1" id="pass1"/></td>
    </tr>
     <tr>
        <td class="field">סיסמה בשנית</td>
        <td><input type="password" name="pass2" id="pass2"/></td>
    </tr>
     <tr>
        <td class="field">כתובת דוא"ל</td>
        <td><input type="email" name="email" id="email"/></td>
    </tr>
    <tr>
        <td class="field">מזונות מועדפים</td>
        <td  Class="ChooseFrom">
            <input type="checkbox" name="food" value="Choclate" id="choc" /> שוקולד <br />
            <input type="checkbox" name="food" value="Fries" id="fries"/> צ'יפס <br />
            <input type="checkbox" name="food" value="Tomatoes and other vegetables" id="veg"/> ירקות ופירות <br />
            <input type="checkbox" name="food" value="Pasta" id="pasta"/> פסטה <br />
            <input type="checkbox" name="food" value="Cheese" id="che"/>גבינה <br />
        </td>
    </tr>
    <tr>
       <td class="field">מגדר</td>

       <td class="ChooseFrom">
            <input type="radio" name="gender" value="Male" id="male"/> זכר <br />
            <input type="radio" name="gender" value="Female" id="femle"/> נקבה <br />
            <input type="radio" name="gender" value="Unde" id="other"/> עדיין לא החלטתי/יש לי בעיה עם שדות בינארים <br />

        </td> 
    </tr>
    <tr>
        <td class="field">living in</td>
        <td>
            <select>
                <option value="TelAviv" id="ny">new york</option>
                <option value="PetaTikwa" id="rome">rome</option>
                <option value="QiryatOno" id="Paris">Paris</option>
                <option value="RamgatGan" id="lv">Las Vegas</option>
                <option value="Haifa" id="ln">London</option>
                <option value="Qraiot" id="bt">Bairut</option>
                <option value="Bash" id="bej">Beijing</option>
                <option value="Eilat" id="tk">Tokyo</option>
            </select>
        </td>
    </tr>
    <tr>
        <td>
            <input type="submit" name="submit" value="הזן נתוניך על פני המים" onsubmit="VerifyForm();"/>
        </td>
    </tr>
</table>
</form>
<hr />
<br /><br /><br /><br />  
<br /><br /><br /><br />
</body>
</html>

thanks again 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:58:18+00:00Added an answer on June 13, 2026 at 1:58 pm

    An idea could be to take onsubmit() out of the form tag.

    then for your button change the onSubmit to onclick='return verifyForm();

    In your verifyForm() method you need to return either true or false; if false, the form won’t submit.

    So, something like this at the end of your verifyForm()

    if (FinalMsg == ""){
        return true;
      }else{
       return false;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.