Le bouton d’envoi des formulaires ne fonctionne pas ? – HTML & CSS – Forums SitePoint

Publié le 13 avril 2022 par Mycamer

j’ai

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="1800; url=../login/logout.php" /><title>Edit Power Strip</title>
<link rel="stylesheet" type="text/css" href="https://www.sitepoint.com/community/t/forms-submit-buttonn-not-working/385133/css/bootstrap.min.css">
<link rel="stylesheet" href="http://www.sitepoint.com/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://www.sitepoint.com/css/tabs.css">
<link rel="stylesheet" href="http://www.sitepoint.com/css/style.css" type="text/css" />
<link href="http://www.sitepoint.com/css/select2.min.css" rel="stylesheet" type="text/css" />
<style>
 img.type {
	margin-right:15px;
	display: inline-block;
	width:40px;
}
.tab label {
    order: 0;
    display: block;
    padding:0;
    margin: 0;
    background: none;
    color: #000;
    border: none;
    transition: none;
}
li.select2-results__option:hover { background-color:#ddd; }
.select2-container { width: 461.77px !important; }
small { font-size:60% }
</style> 
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark" style="margin-bottom:10px">
<a class="navbar-brand mb-2" href="http://www.sitepoint.com/index.php">Data Collection Tool</a>
<p class="text-white position-absolute font-weight-bold font-italic" style="top:35px">Beta</p>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item">
        <a class="nav-link" href="http://www.sitepoint.com/index.php">Home</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="http://www.sitepoint.com/rooms/comms.php">Comms&nbsp;Room</a>
      </li>      
      <li class="nav-item">
        <a class="nav-link" href="http://www.sitepoint.com/rooms/crypto.php">Crypto&nbsp;Room</a>
      </li> 
      <li class="nav-item">
        <a class="nav-link" href="http://www.sitepoint.com/rooms/data.php">Data&nbsp;Center</a>
      </li>      
      <li class="nav-item">
        <a class="nav-link" href="http://www.sitepoint.com/rooms/server.php">Server&nbsp;Room</a>
      </li> 
      <li class="nav-item">
        <a class="nav-link" href="http://www.sitepoint.com/rooms/tech.php">Tech&nbsp;Control</a>
      </li>      
      <li class="nav-item">
        <a class="nav-link" href="http://www.sitepoint.com/rooms/watch.php">Watch&nbsp;Floor</a>
      </li> 

	  </ul>
    <span class="navbar-text">
You&nbsp;are&nbsp;logged&nbsp;in&nbsp;as&nbsp;&nbsp;ssam@industechnology.com&nbsp;&nbsp;<a class="btn btn-danger btn-sm" href="http://www.sitepoint.com/login/logout.php" role="button">Logout</a>	</span>
  </div>
</nav>
<div class="card" style="margin:25px auto; width:85%">
    <div class="card-header">
	  <h2 style="display:inline"><img src="../images/edit_power_strip_icon.png" alt="Power">&nbsp;&nbsp;Edit Power Strip</h2>
    </div>
	<div class="card-body p-3">
	  <form method="post" action="edit_power_strip_engine.php">
		<div class="row"> 
			<div class="col">
				<div class="alert alert-light shadow" role="alert">
					<div class="row">
						<div class="col">	
						  <label for="name">Name (Optional)</label>
						  <input type="text" class="form-control" id="name" name="Name" maxlength="50" value="">						  
						</div>	 
					</div>
					<div class="row mt-3">
						<div class="col">	
						  <label for="Manufacturer">Manufacturer:</label>
							<div class="input-group">
								<div class="input-group-prepend">
								  <span class="input-group-text icon-search text-secondary"></span>
								</div>							  
							  <input list="manufacturers" name="Manufacturer" id="Manufacturer" class="form-control" value="Dell APC" required>	
								<datalist id="manufacturers">
	<option value="Dell">
<option value="Dell APC">
<option value="Interex">
<option value="Lucent Technologies">
<option value="Surge Master">
<option value="Wiremold">
								</datalist>						  
							</div>							
						</div>
					</div>
					<div class="row mt-3">
						<div class="col">	
						  <label for="Model">Model:</label>
							<div class="input-group">
								<div class="input-group-prepend">
								  <span class="input-group-text icon-search text-secondary"></span>
								</div>							  
							  <input list="models" name="Model" id="Model" class="form-control" value="wvbjn" required>	
								<datalist id="models">
	<option value="J58890CH1L1">
<option value="J58890CH1L2">
<option value="J58890CH1L3">
<option value="DM07RM-20T">
<option value="AP6020">
<option value="8558N">
<option value="J60B2B20X">
								</datalist>						  
							</div>							
						</div>
					</div>
					<div class="row mt-3">
						<div class="col">	
						  <label for="Voltage">Voltage:</label>
							<div class="input-group">
								<div class="input-group-prepend">
								  <span class="input-group-text">#</span>
								</div>						  
								  <select class="form-control" id="Voltage" name="Voltage">
								  <option value="120">120</option>
								  <option value="120">120</option>
								  <option value="208">208</option>
								  <option value="240">240</option>
								  </select>						 	
								<div class="input-group-append">
								  <span class="input-group-text">Volts</span>
								</div>	
							</div>						
						</div>
					</div>
					<div class="row mt-3">
						<div class="col">
					      <label for="Rack">Rack (Row, Bay)</label>
						  <select class="form-control" name="Rack" id='Rack'>
						  <option value="1">jo, 1</option>
<option value=1>(jo, 1)</option>	
						  </select>
						</div>
					</div>
					<div class="row mt-3 mb-5">
						<div class="col">
						  <label for="operational_status">Operational Status</label>
						  <select class="form-control" id="operational_status" name="operational_status">
<option value="1">Yes</option><option value="0">No</option>						  </select>
						</div>
					</div>
				</div>
			</div>
			<div class="col">
			  <h6 class="mb-2"><a href="#guide"><span class="icon-question"></span>&nbsp;&nbsp;Receptacle/Outlett Reference</a></h6>
				<div class="row mt-3">
					<div class="col">
					  <label for="Receptacle">Receptacle</label>
						<div class="input-group">
							<div class="input-group-prepend">
							  <span class="input-group-text icon-search text-secondary"></span>
							</div>							  
						  <input list="receptacles" name="Receptacle" id="Receptacle" class="form-control" maxlength="25" required value="NEMA L6-20R">					
						  <datalist id="receptacles">
							 <option value="NEMA L5-20R">
							 <option value="NEMA L5-30R">
							 <option value="NEMA L6-20R">
							 <option value="NEMA L6-30R">
							 <option value="NEMA L21-20R">
							 <option value="NEMA L21-30R">
						  </datalist>
					    </div>	
					</div>
				</div>						
				<div class="row mt-3">
					<div class="col">
					  <label for="r_type1">Outletts</label>
						<div class="tabs">
						  <input type="radio" name="tab" id="tabone" checked>
						  <label for="tabone">Group 1</label>
							<div class="tab">						
								<div class="form-group">
								  <label for="r_type1" style="font-size:.95em">Type</label>
									<div class="input-group">
										<div class="input-group-prepend">
										  <span class="input-group-text icon-search text-secondary"></span>
										</div>							  
									  <input list="r_types1" name="r_type1" id="r_type1" class="form-control" maxlength="25" value="NEMA 5-20R" required>				
									  <datalist id="r_types1">
										 <option value="NEMA 5-15R">
										 <option value="NEMA 5-20R">
										 <option value="IEC-320 C13">
										 <option value="IEC-320 C19">
									  </datalist>
									</div>	
								</div>
								<div class="form-group">
								   <label for="Count" style="font-size:.95em">Count</label>
									  <div class="input-group">
										<div class="input-group-prepend">
										  <span class="input-group-text">#</span>
										</div>	
											<select id='Count' name="Count" class="form-control">
											 <option value="3">3</option>
											 <option value="1">1</option>
											 <option value="2">2</option>
											 <option value="3">3</option>
											 <option value="4">4</option>
											 <option value="5">5</option>
											 <option value="6">6</option>
											 <option value="7">7</option>
											 <option value="8">8</option>
											 <option value="9">9</option>
											 <option value="10">10</option>
											 <option value="11">11</option>
											 <option value="12">12</option>
											 <option value="13">13</option>
											 <option value="14">14</option>
											 <option value="15">15</option>
											 <option value="16">16</option>
											 <option value="17">17</option>
											 <option value="18">18</option>
											 <option value="19">19</option>
											 <option value="20">20</option>
											</select>
										  </div>
									 </div>
								</div>
							  <input type="radio" name="tab" id="tabtwo">
							  <label for="tabtwo">Group 2</label>
								<div class="tab">						
									<div class="form-group">
									  <label for="r_type2" style="font-size:.95em">Type</label>
										<div class="input-group">
											<div class="input-group-prepend">
											  <span class="input-group-text icon-search text-secondary"></span>
											</div>							  
										  <input list="r_types2" name="r_type2" id="r_type2" class="form-control" maxlength="25" value="" required>					
										  <datalist id="r_types2">
											 <option value="NEMA 5-15R">
											 <option value="NEMA 5-20R">
											 <option value="IEC-320 C13">
											 <option value="IEC-320 C19">
										  </datalist>
									    </div>	
									</div>
									<div class="form-group">
									   <label for="Count2" style="font-size:.95em">Count</label>
										  <div class="input-group">
											<div class="input-group-prepend">
											  <span class="input-group-text">#</span>
											</div>	
											<select id='Count2' name="Count2" class="form-control">
											 <option value="0">0</option>
											 <option value="1">1</option>
											 <option value="2">2</option>
											 <option value="3">3</option>
											 <option value="4">4</option>
											 <option value="5">5</option>
											 <option value="6">6</option>
											 <option value="7">7</option>
											 <option value="8">8</option>
											 <option value="9">9</option>
											 <option value="10">10</option>
											 <option value="11">11</option>
											 <option value="12">12</option>
											 <option value="13">13</option>
											 <option value="14">14</option>
											 <option value="15">15</option>
											 <option value="16">16</option>
											 <option value="17">17</option>
											 <option value="18">18</option>
											 <option value="19">19</option>
											 <option value="20">20</option>
											</select>
										 </div>
									</div>
								</div>
							  <input type="radio" name="tab" id="tabthree">
							  <label for="tabthree">Group 3</label>
								<div class="tab">						
									<div class="form-group">
									  <label for="r_type3" style="font-size:.95em">Type</label>
										<div class="input-group">
											<div class="input-group-prepend">
											  <span class="input-group-text icon-search text-secondary"></span>
											</div>							  
										  <input list="r_types3" name="r_type3" id="r_type3" class="form-control" maxlength="25" value="" required>					
										  <datalist id="r_types3">
											 <option value="NEMA 5-15R">
											 <option value="NEMA 5-20R">
											 <option value="IEC-320 C13">
											 <option value="IEC-320 C19">
										  </datalist>
									    </div>	
									</div>
									<div class="form-group">
									   <label for="Count3" style="font-size:.95em">Count</label>
										  <div class="input-group">
											<div class="input-group-prepend">
											  <span class="input-group-text">#</span>
											</div>	
											<select id='Count3' name="Count3" class="form-control">
											 <option value="0">0</option>
											 <option value="1">1</option>
											 <option value="2">2</option>
											 <option value="3">3</option>
											 <option value="4">4</option>
											 <option value="5">5</option>
											 <option value="6">6</option>
											 <option value="7">7</option>
											 <option value="8">8</option>
											 <option value="9">9</option>
											 <option value="10">10</option>
											 <option value="11">11</option>
											 <option value="12">12</option>
											 <option value="13">13</option>
											 <option value="14">14</option>
											 <option value="15">15</option>
											 <option value="16">16</option>
											 <option value="17">17</option>
											 <option value="18">18</option>
											 <option value="19">19</option>
											 <option value="20">20</option>
											</select>
										  </div>
										</div>
									</div>				
								</div>				
						</div>
					</div>
				</div>		
				<div class="col">
					<div class="form-group" style="margin-bottom:.5rem">
					  <label for="Location">Location</label>						  
						<div class="input-group">
							<div class="input-group-prepend">
							  <span class="input-group-text icon-search text-secondary"></span>
							</div>							  
						  <input list="locations" name="Location" id="Location" class="form-control" maxlength="25" required value="Top-Right">					
						  <datalist id="locations">
							<option value="Top-Left">
							<option value="Top-Right">
							<option value="Middle-Left">
							<option value="Middle-Right">
							<option value="Bottom-Left">
							<option value="Bottom-Right">
						  </datalist>
						</div>
					</div>	
<svg viewBox="0 0 75 85">
<defs>
  <pattern id="pattern" x="0" y="0" width="4" height="4" patternUnits="userSpaceOnUse" patternTransform="rotate(-45)">
    <rect fill="#dc3545" x="0" y="0" width="4" height="2"></rect>
    <rect fill="white" x="0" y="2" width="4" height="2"></rect>
  </pattern>
<style>
rect.power_strip_in_rack {
      fill:url(#pattern);
      stroke:#000;
      stroke-width:.2;
}
</style>
</defs>
 <rect x="5" y="2" width="25" height="75" style="fill:rgb(255,255,255);stroke-width:.6;stroke:rgb(0,0,0)" />			
 <rect x="25" y="5" width="3" height="9" class="power_strip_in_rack" />			
</svg>					
			
				</div>
			</div>
			<div class="row justify-content-center">
				<div class="col-4" style="margin-top:25px">	
				  <button type="submit" class="btn btn-outline-dark btn-block btn-lg"><span class="icon-pencil"></span>&nbsp;&nbsp;Edit</button>
				  <input type="hidden" name="power_strip_id" value="1">
				</div>
			</div>
		  </form>
		</div>
</div>
<div id="guide" class="overlay">
	<div class="popup">
	  <a class="close" href="#">&times;</a>
		<div class="content p-3">
		  <h4>Types of Recepticals <small>(Under the Floor)</small></h4>
		  <hr>
		  <figure class="figure">
		  <img src="../images/plug_type_7.png" class="figure-img img-fluid rounded" alt="NEMA 5-15R" width="100">
		  <figcaption class="figure-caption text-center">NEMA L5-20R</figcaption>
		  </figure>
		  <figure class="figure">
		  <img src="../images/plug_type_8.png" class="figure-img img-fluid rounded" alt="NEMA 5-20R" width="100">
		  <figcaption class="figure-caption text-center">NEMA L5-20R</figcaption>
		  </figure>
		  <figure class="figure">
		  <img src="../images/plug_type_9.png" class="figure-img img-fluid rounded" alt="NEMA L6-20R" width="100">
		  <figcaption class="figure-caption text-center">NEMA L6-20R</figcaption>
		  </figure>
		  <figure class="figure">
		  <img src="../images/plug_type_10.png" class="figure-img img-fluid rounded" alt="NEMA L6-30R" width="100">
		  <figcaption class="figure-caption text-center">NEMA L6-30R</figcaption>
		  </figure>
		  <figure class="figure">
		  <img src="../images/plug_type_11.png" class="figure-img img-fluid rounded" alt="NEMA L21-20R" width="100">
		  <figcaption class="figure-caption text-center">NEMA L21-20R</figcaption>
		  </figure>
		  <figure class="figure">
		  <img src="../images/plug_type_12.png" class="figure-img img-fluid rounded" alt="NEMA L21-30R" width="100">
		  <figcaption class="figure-caption text-center">NEMA L21-30R</figcaption>
		  </figure>
		  <h4>Types of Outletts <small>(Grouped in Power Strips)</small></h4>
		  <hr>
		  <figure class="figure">
		  <img src="../images/plug_type_1.png" class="figure-img img-fluid rounded" alt="NEMA 5-15R" width="100">
		  <figcaption class="figure-caption text-center">NEMA 5-15R</figcaption>
		  </figure>
		  <figure class="figure">
		  <img src="../images/plug_type_2.png" class="figure-img img-fluid rounded" alt="NEMA 5-20R" width="100">
		  <figcaption class="figure-caption text-center">NEMA 5-20R</figcaption>
		  </figure>
		  <figure class="figure">
		  <img src="../images/plug_type_3.png" class="figure-img img-fluid rounded" alt="IEC-320 C13" width="100">
		  <figcaption class="figure-caption text-center">IEC-320 C13</figcaption>
		  </figure>
		  <figure class="figure">
		  <img src="../images/plug_type_4.png" class="figure-img img-fluid rounded" alt="IEC-320 C19" width="100">
		  <figcaption class="figure-caption text-center">IEC-320 C19</figcaption>
		  </figure>
		</div>
	</div>
</div>


<!--
<script src="../scripts/jquery-3.0.0.js" type="text/javascript"></script>

 select2 script 
<script src="../scripts/select2.min.js"></script>        
<script>
$(document).ready(function(){
	$("#r_type1").select2({
		templateResult: formatOptions,
		minimumResultsForSearch: Infinity
	});
	$("#r_type2").select2({
		templateResult: formatOptions,
		minimumResultsForSearch: Infinity
	});
	$("#r_type3").select2({
		templateResult: formatOptions,
		minimumResultsForSearch: Infinity
	});	
});

function formatOptions (state) {
	if (!state.id) { return state.text; }

	console.log(state.element.value);
		var $state = $(
	'<span><img class="type" src="../images/plug_type_' + state.element.value.toLowerCase() + '.png"  /> ' + state.text + '</span>'
	);
	return $state;
}
</script>
-->
<script src="../scripts/popper.min.js"></script>
<script src="../scripts/bootstrap.min.js"></script>
</body>
</html>

la page valide, mais le bouton semble ne rien faire

Une copie de votre code est soumise à l’URL d’action pour moi. La page à laquelle vous soumettez est probablement redirigée vers le formulaire.

Pour fournir la meilleure expérience utilisateur (UX) possible et utiliser le moins de code possible, le code de traitement du formulaire et le formulaire doivent se trouver sur la même page.

— to www.sitepoint.com