Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Basic form design

  • 05-01-2017 04:54PM
    #1
    Closed Accounts Posts: 191 ✭✭


    Hey how do i make it so when my mouse hoovers over my textboxes the outline lights blue? Thank you.


Comments

  • Registered Users, Registered Users 2 Posts: 6,207 ✭✭✭miralize


    Something like this in CSS
    input:hover {
    box-shadow: 0 3px 3px blue;
    transition: all 300ms ease-in-out;
    }
    


  • Closed Accounts Posts: 191 ✭✭chocolate boy123


    Thank you! Can i ask why my validation is not working either is my fieldset?
    <script>
    	
    		function submitFunction(){
    			var userName = document.forms["registrationForm"]["username"].value;
    			var firstPassword = document.forms["registrationForm"]["pass1"].value;
    			var secondPassword = document.forms["registrationForm"]["pass2"].value;
    			var userAddress = document.forms["registrationForm"]["address"].value;
    			var userEmail = document.forms["registrationForm"]["email"].value;
    			
    			if(userName == ""){
    				alert("All fields are mandatory!");
    				return false;
    			}
    			else if (firstPassword == null){
    				alert("All fields are mandatory!");
    				return false;
    			}
    			else if (secondPassword == null){
    				alert("All fields are mandatory!");
    				return false;
    			}
    			else if (userAddress == null){
    				alert("All fields are mandatory!");
    				return false;
    			}
    			else if (userEmail == null){
    				alert("All fields are mandatory!");
    				return false;
    			}
    			else if (firstPassword != secondPassword){
    				alert("Passwords do not match!");
    				return false;
    			}
    		}
    	
    	</script> <!-- Form validation -->
    	
    	<div id ="registrationForm">
    		<h1> Create Account </h1>
    	
    		<form name = "userRegistration" onsubmit ="return submitFunction()" method ="POST">
    			<fieldset>	
    			
    				<label>Your name </label> 
    				<p><input type ="text" name ="username"></p>
    				<label>Password</label>
    				<p><input type ="password" name ="pass1"></p>
    				<label>Retype Password</label>
    				<p><input type ="password" name ="pass2"></p>
    				<label>Address</label>
    				<p><textarea rows ="6" cols = "22" name ="address"> </textarea></p>
    				<label>Email</label>
    				<p><input type ="email" name ="email"></p>
    			    <span style="color: blue"><input type ="submit" value = "Create Rochvalle Account">
    			
    			</fieldset>
    		</form>
    	</div>
    


  • Closed Accounts Posts: 9,698 ✭✭✭tricky D


    You haven't closed the span at the submit bit.


  • Closed Accounts Posts: 191 ✭✭chocolate boy123


    What do you mean? I do not have any span tags.


  • Closed Accounts Posts: 9,698 ✭✭✭tricky D


    You definitely do.
    <[B]span [/B]style="color: blue"><input type ="submit" value = "Create Rochvalle Account">
    


  • Advertisement
Advertisement