Results 1 to 2 of 2

Thread: Display user information onscreen using forms

  1. #1
    Join Date
    May 2010
    Location
    Canada
    Posts
    31

    Display user information onscreen using forms

    Would anyone be able to explain to me how to keep user information, obtained using forms, displayed onscreen for future visits?

    Here is my code :
    Code:
    <html>
    	<head>
    		<title>Exercice_7</title>
    	</head>
    	
    	<script language="javascript">
    	function getInfo(){
    		
    		var info_1 = document.forms[0].user_name.value;
    		var info_2 = document.forms[0].user_email.value;
    		var info_3 = document.skynet.user_color.value;
    		
    		document.getElementById('show_info_1').innerHTML = info_1;
    		document.getElementById('show_info_2').innerHTML = info_2;
    		document.bgColor = info_3;
    		
    	}
    	</script>
    	
    	<body>
    		<center>
    		<form name="skynet">
    		<table border="1">
    		  <tr>
    		  	 <td>
                <p>Prénom : </p>
    		    </td>
    	        <td>
    			<input type="text" name="user_name" size="25px">
    			</td>
    		  </tr>
    		  <tr>
    		  	 <td>
                <p>Famille : </p>
    		    </td>
    	        <td>
    			<input type="text" name="user_email" size="25px">
    			</td>
    		  </tr>
    		  <tr>
    		  	 <td>
                <p>Couleur Préférée : </p>
    		    </td>
    	        <td>
    			<input type="text" name="user_color" size="25px">
    			</td>
    		  </tr>
    			
              <tr>
              	<td>
              		&nbsp;
    			</td>
    			<td>
    			<input type="button" value="Envoyer" onClick="getInfo(this.form)">
    			<input type="reset" value="Annuler">
    			</td>
    		  </tr>
    
    		  <tr>
    		  	<td>
    		  		<br /><br /><br /><br />
    		  	</td>
    			<td>
    		  		<br /><br /><br /><br />
    		  	</td>
    		  <tr>
    		  	<td>
    		  		<p>Votre prénom : </p>
    		  	</td>
    		  	<td>
    		  		<p id="show_info_1"></p>
    				
    		  	</td>
    		  </tr>
    		  <tr>
    		  	<td>
    		  		<p>Nom de famille : </p>
    		  	</td>
    		  	<td>
    		  		<p id="show_info_2"></p>
    				
    		  	</td>
    		  </tr>
    		</table>
    		</form>
    		</center>
    
    	</body>
    </html>
    I want to keep the information displayed and the background color for every visit. Can i achieve this without using php?

    Thank you for support!

  2. #2
    Join Date
    May 2010
    Location
    Canada
    Posts
    31
    I found a working example of what i wanted. Its called témoin in french. It creates cookies and then calls them back, pretty cool stuff.

Similar Threads

  1. Information on forms.
    By m1ck3y in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 18 Jul 2010, 02:23 PM
  2. Storing detailed user information
    By fried sock in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 03 Aug 2009, 12:45 PM
  3. Information Architecture for the WWW
    By Manksio in forum The Lounge
    Replies: 0
    Last Post: 13 Jun 2006, 06:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •