Jump to content
Sign in to follow this  
Shibitto

Advice on JavaScript samantic html relationship

Recommended Posts

Hay can someone offer some input(it's definitely not mobile friendly what I wrote) in regards to JavaScript and the html form document, I can't recalls the relationship while testing the JavaScript logic, any inputs welcome. Definitely recommend looking at it via desktop mode if on tablet or phone. 🤗

 


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

   <div class="one">
   <form action="
   " method="post" onsubmit = "return register_details();" />
     <!--C--> Country<br><input type="text"id="country"/></br>
	 <!--A--> Age<br><input type="age"id="DOB"/></br>
	 <!--S--> Status<br><input type="text"id="status"/></br>

				
					 
    
     </form>
	 </div>

     <div class="two">
	 
	 <form action="submission.html" method="register_details(id)" onsubmit = "return register_details();" />
     <!--U-->UserName<br><input type="text"    value=""	id="UsernName"/></br>
	 <!--P-->Password<br><input type="password"value=""	id="Password"/></br>
	 <!--E-->   Email<br><input type="Email"   value=""	id="Email"/></br>
	            Male<br><input  type="radio"   value=""	id="male" /></br>
               Female<br><input type="radio"   value="female" id="female" /></br>
			   Submit<br><input type="submit"  value="register" id ="submit "/></br>
	</form>
	</div>
  
  
	 <style type="text/css">
	.one {
     background-color:#444444;
     color:white;
     margin:350px;
     padding:12px;
	 text-align:left;
	 position:fixed;
	 
	 }
	.two {
	 background-color:#444444;
     color:white;
     margin:350px;
     padding:12px;
	 text-align:center;
	 position:fixed;
	 left:10px;
     top:240px;
	 width:1157px;
     height:1000px;
     background:#444444;
	 
}
	//body
 {
    overflow:hidden;
}
	
	 </style>
	 <!-----------------------------------------------> 
	 <script type="text/javascript">

     function register_details(id)  {
     
	 
   // bool checked = false;
    
     var username = document.getElementById (id,value,"username").value;
     var password = document.getElementById (id,"password").value;
     var email = document.getElementById (id,"email").value;
     var male = document.getElementById (id,"male").value;
     var female = document.getElementById (id,"female").value;
	 <!------------------------------------------------------>
     var submit = document.getElementById (id,"register").value;
	 
     if ((value === "") || (password === "") || (email === "")) {
    	
	 alert("please correct information");
	
}if ((male[0].checked === false ) && ( female[1].checked === false )){
		
		console.log("please fix gender");	
		} else  if (ErrorText= "") {

	  alert("please correct information");
      }else{
      	submit(register_details(id))
		}
		}
	 
     </script>
	 
	 
	 <!------------------------------------------------>
	
    </body>
    </body>
    </html>
    

 

Edited by Shibitto

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...