Comment récupérer le value d'un champ
Akim13
Messages postés
60
Statut
Membre
-
Alain42 -
Alain42 -
Bonjour,
Comment récupérer le value du champ le champ "toto" SVP
<a href="javascript:outsideWindow();"> Editer </a>
<input type="text" value="<?=$id?>" size=1 name=toto>
<script>
function outsideWindow() {
var win = new Window("win2", {className: "alphacube", top:0, left:0, width:800, height:500,
url: "gestionedi.php?id=” _ICI_ ", showEffectOptions: {duration:1.5}})
win.show();
}
</script>
Merci d'avance,
Comment récupérer le value du champ le champ "toto" SVP
<a href="javascript:outsideWindow();"> Editer </a>
<input type="text" value="<?=$id?>" size=1 name=toto>
<script>
function outsideWindow() {
var win = new Window("win2", {className: "alphacube", top:0, left:0, width:800, height:500,
url: "gestionedi.php?id=” _ICI_ ", showEffectOptions: {duration:1.5}})
win.show();
}
</script>
Merci d'avance,
A voir également:
- Comment récupérer le value d'un champ
- Comment recuperer un message supprimé sur whatsapp - Guide
- Comment récupérer un compte facebook piraté - Guide
- Comment recuperer une video sur youtube - Guide
- Comment récupérer un document dans le presse papier - Guide
- Récupérer mon compte facebook désactivé - Guide
5 réponses
Si c'est dans ta fonction javascript que tu veux la récuperer :
tu "lit" le champ par
id=document.getElementById('toto').value
ou
id=document.nom_formulaire.toto.value
le champ doit être:
<form name="nom_formulaire" id="nom_formulaire">
<input type="text" value="" size="1" name="toto" id="toto">
</form>
Je suppose que c'est ce que l'utilisateur saisi dans ce champ que tu veux lire.
Attention n'oublie pas les " " dans les def des name, id etc.....
tu "lit" le champ par
id=document.getElementById('toto').value
ou
id=document.nom_formulaire.toto.value
le champ doit être:
<form name="nom_formulaire" id="nom_formulaire">
<input type="text" value="" size="1" name="toto" id="toto">
</form>
Je suppose que c'est ce que l'utilisateur saisi dans ce champ que tu veux lire.
Attention n'oublie pas les " " dans les def des name, id etc.....
Bonjour,
Oui j’ai oublier de vous dire que je place <? echo $_POST["visa"]; ?> ou <?=$id?> mais il me donne toujours le dernier numéro de $id car il y a une boucle qui ne veut pas marcher entre <script> </script>
for($ii=0; $ii<$ct; $ii++){
$id = $fichiers_ary[$ii]["id"];
merci si vous avez une solution
Oui j’ai oublier de vous dire que je place <? echo $_POST["visa"]; ?> ou <?=$id?> mais il me donne toujours le dernier numéro de $id car il y a une boucle qui ne veut pas marcher entre <script> </script>
for($ii=0; $ii<$ct; $ii++){
$id = $fichiers_ary[$ii]["id"];
merci si vous avez une solution
Si c'est ebtre les balise <script> et </script>
C'est du javascript, alors que à première vue ta boucle for est du php
C'est du javascript, alors que à première vue ta boucle for est du php
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Bonjour,
J’avais déjà essayer cette méthode et celle la aussi <? echo $toto; ?>
Mais ça ne marche pas avec un lien direct ça marche.
<a href='gestion_fichier_edi.php?id=<?=$id?>' style="text-decoration:none"><br>Editer le fichier<border=0></a>
Voila le script de ma Page 1 sur 1
J’avais déjà essayer cette méthode et celle la aussi <? echo $toto; ?>
Mais ça ne marche pas avec un lien direct ça marche.
<a href='gestion_fichier_edi.php?id=<?=$id?>' style="text-decoration:none"><br>Editer le fichier<border=0></a>
Voila le script de ma Page 1 sur 1
<?php
include('fichier_n/gestion_fichier_root.php');
include('include/gestion_liste_vps.php');
?>
<!-- fenetre du script http://prototype-window.xilinus.com -->
<script type="text/javascript" src="../javascripts/prototype.js"> </script>
<script type="text/javascript" src="../javascripts/window.js"> </script>
<script type="text/javascript" src="../javascripts/debug.js"> </script>
<script type="text/javascript" src="../javascripts/effects.js"> </script>
<link href="../themes/default.css" rel="stylesheet" type="text/css" > </link>
<link href="../themes/alphacube.css" rel="stylesheet" type="text/css" > </link>
<!-- fun fenetre du script http://prototype-window.xilinus.com -->
<form method="post" name="form1" id="form1">
<table width="<?=$page_table_width?>" border="2" align=center style="border-color:FF9900; border-style:dashed;" cellspacing="0" bordercolordark="white" bordercolorlight="black">
<tr><td colspan=0 align='center'><span class=title1><?=ADMIN_INV_MENU?>
<? if($pforcewhere != ''){ echo ' - '.SEARCH_RESULT; } ?></span><br>
</td>
</tr>
<tr><td><br><span class=title2><?=INV_LIST?></span><small>
<?
if($showall == 'yes'){
// echo "(<a href='gestion_liste_vps.php?sa=yes$qfid'><b>".SHOW_ALL."</b></a> | ";
}else{
// echo "(<a href='gestion_liste_vps.php?sa=yes$qfid'>".SHOW_ALL."</a> | ";
}
if(!isset($showall) || $showall == 'no' || $showall == ''){
// echo "<a href='gestion_liste_vps.php?sa=no$qfid'><b>".HIDE_PAID."</b></a> | ";
}else{
// echo "<a href='gestion_liste_vps.php?sa=no$qfid'>".HIDE_PAID."</a> | ";
}
if($showall == 'pastdue'){
// echo "<a href='gestion_liste_vps.php?sa=pastdue$qfid'><b>".SHOW_PAST_DUE."</b></a>)";
}else{
// echo "<a href='gestion_liste_vps.php?sa=pastdue$qfid'>".SHOW_PAST_DUE."</a>)";
}
?>
<!-- </small><br><b><?=TIP?></b> <?=TIPMSG?>-->
<?
if($showall == 'yes'){
echo "<b>".TIP1."</b>";
}elseif($showall == 'pastdue'){
echo "<b>".TIP3."</b>";
}else{
echo "<b>".TIP2."</b>";
}
?>
</td>
<?
if($totalpgs > 1){
echo "<td align=right valign=bottom><b>".PAGE." </b>";
$queryStr = $pq.$dir.$queryfw.'&sa='.$showall.$qfid;
echo $fichiers->constructPageSelect($pgnum, $totalpgs, $queryStr);
echo '</td>';
}
?>
</tr></table>
<?
$aclients = 'iv.clientid > 0';
if($fid == $client_id){
$aclients = 'iv.clientid > 0';
}else{
$aclients = "iv.clientid = '$fid' ";
}
$where = " WHERE ".$aclients.$hidePaye.$pforcewhere;
if (!$param) {
$orderBy = " ORDER BY iv.id";
}else{
$orderBy = " ORDER BY `$param`";
}
if(isset($dirc) && $dirc == 'ASC'){
$orderBy = $orderBy." ASC";
$dirc = 'DESC';
}else{
$orderBy = $orderBy." DESC";
$dirc = 'ASC';
}
if ($totalpgs > 1){
$orderBy .= ' LIMIT '.$pgnum*$pagesize.", $pagesize";
}
$fichiers_ary = $fichiers->getfichiersclientsInfo($where, $orderBy);
$colspan=1;
if ($totalpgs > 1){
$colspan=2;
}
$ct=count($fichiers_ary);
?>
<script language="javascript"> <!--
var b = new Array(<?=$ct?>);
for(var i=0; i<<?=$ct?>; i++){
b[i] = true;
}
function changeOver(obj,color,idx)
{
if(!b[idx]) return;
obj.style.backgroundColor=color;
}
function changeDown(obj, color1, color2, idx)
{
b[idx] = !b[idx];
if(b[idx]){
obj.style.backgroundColor=color2;
}else{
obj.style.backgroundColor=color1;
}
}
function delfichiers(){
var pids = "";
for (counter = 0; counter < document.form1.selIds.length; counter++)
{
if (document.form1.selIds[counter].checked)
{
pids = pids + document.form1.selIds[counter].value+",";
}
}
pids = pids.substring(0, pids.length-1);
var cm = confirm("<?=DEL_CONFIRM_PROMPT?> ["+pids+"]");
if(cm == true){
this.location.href = "gestion_fichier_sup.php?delmany=yes&invIds="+pids;
}
}
function toggleChecks(){
var pids = "";
for (counter = 0; counter < document.form1.selIds.length; counter++)
{
if (document.form1.selIds[counter].checked)
{
document.form1.selIds[counter].checked = false;
}else{
document.form1.selIds[counter].checked = true;
}
}
}
// -->
</script>
<table width="<?=$page_table_width?>" border="9" align=center style="border-color:FF9900; border-style:dashed;" cellspacing="0" bordercolordark="white" bordercolorlight="black">
<tr align=top class=header>
<?
$headerNames = array('Menu', 'fullname'=>client_NAME,
'company'=>client_COMPANY_NAME, 'date'=>CREATE_DATE,
'due_date'=>DUE_DATE, 'total'=>TOTAL, 'status'=>PAY_STATUS);
$qStr = $queryfw.'&dirc='.$dirc.'&sa='.$showall.$qfid;
if(!isset($param)){
$param = 'id';
}
foreach ($headerNames as $key => $value){
?>
<td align=center><b><a href='gestion_liste_vps.php?param=<?=$key.$qStr?>'><?=$value?>
<? if($param == $key){
echo '<img src="images/'.strtolower($dirc).'.gif" border=0 align="absmiddle">';
}
?></a></b></td>
<?}?>
<!--<td align=center><b><?=NOTIFY_DATES?></b></td>-->
<td align=center><b><?=COMMENTS?></b></td>
<td align=center nowrap><b><?=ACTION?></b></td>
</tr>
<?
for($ii=0; $ii<$ct; $ii++){
$id = $fichiers_ary[$ii]["id"];
$order_id = $fichiers_ary[$ii]['order_id'];
$clientid = $fichiers_ary[$ii]["clientid"];
//last parameter, encode empty string into HTML
$clientcompanyname = $fichiers->truncateLongName($fichiers_ary[$ii]['company'], $max_num_char_company_name, true);
$date = $fichiers_ary[$ii]["date"];
$due_date = $fichiers_ary[$ii]['due_date'];
$dateshow = fixDate($date, DATE_FORMAT_SHORT);
$due_dateshow=fixDate($due_date, DATE_FORMAT_SHORT);
$total = $fichiers_ary[$ii]["total"];
$status = $fichiers_ary[$ii]["status"];
$notifycount = $fichiers_ary[$ii]['notifycount'];
$notifydates = $fichiers_ary[$ii]['notifydates'];
$comments = $fichiers_ary[$ii]['comments'];
$moneyunit = $fichiers_ary[$ii]['moneyunit'];
if(strlen($clienttitle) > $max_num_char_title){
$clienttitle = substr($clienttitle, 0, $max_num_char_title)."...";
}
$clientname = $fichiers->truncateLongName($fichiers_ary[$ii]['fullname'], $max_num_char_client_name, true);
$mouse_over_effect = '';
if ($alternate == "1") {
$rowclass = "class='row2'";
$alternate = "2";
if($enable_mouse_over_effect){
$mouse_over_effect =' onmouseover="changeOver(this,\''.$mouse_over_color.'\','.$ii.');" onmouseout="changeOver(this,\''.$row_default_color2.'\','.$ii.');" onmousedown="changeDown(this,\''.$row_mark_color.'\', \''.$row_default_color2.'\', '.$ii.');" ';
}
}else {
$rowclass = "class='row1'";
$alternate = "1";
if($enable_mouse_over_effect){
$mouse_over_effect =' onmouseover="changeOver(this,\''.$mouse_over_color.'\','.$ii.');" onmouseout="changeOver(this,\''.$row_default_color1.'\','.$ii.');" onmousedown="changeDown(this,\''.$row_mark_color.'\', \''.$row_default_color1.'\', '.$ii.');" ';
}
}
?>
<!--<tr valign=top <?=$rowclass?> <?=$mouse_over_effect?>>
<td nowrap><input type="checkbox" value="<?=$id?>"name="selIds"><br><?=$id?></td>-->
<!-- MENU H -->
<td width="71"><script type="text/javascript" language="JavaScript1.2" src="menu_h/stmenu.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="menu_h/menu.js"></script></td>
<!--<td> <?=$order_id?></td>-->
<td width="200" align="center" style="margin:1pt; padding:1pt; border-width:1pt; border-color:maroon; border-style:dashed;" ><?=$clientname?></td>
<td width="200" align="center" style="margin:1pt; padding:1pt; border-width:1pt; border-color:maroon; border-style:dashed;" ><?=$clientcompanyname?></td>
<td width="70" align="center" style="margin:1pt; padding:1pt; border-width:1pt; border-color:maroon; border-style:dashed;" ><?=$dateshow?></td>
<td width="70" align="center" style="margin:1pt; padding:1pt; border-width:1pt; border-color:maroon; border-style:dashed;" ><?=$due_dateshow?></td>
<td width="65" align="center" style="margin:1pt; padding:1pt; border-width:1pt; border-color:maroon; border-style:dashed;" ><?=$moneyunit.$total?></td>
<td width="99" align=center style="margin:1pt; padding:1pt; border-width:1pt; border-color:maroon; border-style:dashed;" ><img src='images/<?=strtolower($status)?>.gif' border=0 alt='<?=$status?>'></td>
<!--<td align=center><?=$notifycount?></td>-->
<!--<td width="60" align=center> <? if($notifycount > 0){
echo "<a href=javascript:showhide('div$ii');><img src='images/view.gif' border='0' alt='".TOG_VIEW."'></a><div id='div$ii' style='display:none'>$notifydates</div>";
} ?></td>-->
<td width="100" align=center style="margin:1pt; padding:1pt; border-width:1pt; border-color:maroon; border-style:dashed;" > <? if(strlen($comments) > 0){
echo "<a href=javascript:showhide('cmt$ii');>Voir</a><div id='cmt$ii' style='display:none'>$comments</div>";
}
?></td>
<td align="center" style="margin:1pt; padding:1pt; border-width:1pt; border-color:maroon; border-style:dashed;" nowrap>
<?
if ($status == 'En_attente' || $status == 'Partielle') {
echo "<a href='gestion_fichier_prev.php?id=$id' style=text-decoration:none>Prévisualiser<br></a>";
echo "<a href='domain_fichiert_art_gestion.php?id=$id' style=text-decoration:none >Mettre а jour</a>";
}else {
echo "<p width=100 align=center ><a href='domain_fichiert_art_gestion.php?id=$id' style=text-decoration:none >Prévisualiser<border=0></a>";
}
?>
<a href='gestion_mai_2.php?id=<?=$id?>' style="text-decoration:none"><br>Annoncer<border=0 ></a>
<a href='gestion_fichier_edi.php?id=<?=$id?>' style="text-decoration:none"><br>Editer le fichier<border=0></a>
<a href='gestion_fichier_pdf.php?id=<?=$id.'&R='.time()?>' style="text-decoration:none"><br>Voir le fichier<border=0 align='absmiddle'><br></a>
<input type="text" value="<?=$id?>" size=1 name=visa>
<a href="javascript:outsideWindow();"> Editer le fichier TESTE </a>
<script>
function outsideWindow() {
var win = new Window("win2", {className: "alphacube", top:0, left:0, width:800, height:500,
url: 'gestion_fichier_edi.php?id=<? echo $_POST["visa"]; ?>', showEffectOptions: {duration:1.5}})
win.show();
}
</script>
<!--<script>
function outsideWindow() {
var win = new Window("win2", {className: "alphacube", top:0, left:0, width:800, height:500,
url: 'gestion_fichier_edi.php?id=<?=$id?>', showEffectOptions: {duration:1.5}})
win.show();
}
</script>-->
<a href='gestion_fichier_sup.php?id=<?=$id?>' style="text-decoration:none" onClick="return confirm('<?=DEL_CONFIRM_PROMPT.' '.$id?>? ');"><br>Supprimer le fichier<border=0></a>
</td>
</tr>
<? } ?>
</table>
<table width="<?=$page_table_width?>" border="5" align=center style="border-color:FF9900; border-style:dashed;" cellspacing="0" bordercolordark="white" bordercolorlight="black">
<tr><td colspan="0"><img src="images/withselect.png" align="absmiddle"><a href="javascript:delfichiers();"><img src='images/delete.gif' align='absmiddle' alt='delete products' border="0"> <?=DEL_INV?></a> | <a href="javascript:toggleChecks();">Inverser la selection</a></td>
<? if($totalpgs > 1){ ?>
<td align=right valign=top><b><?=PAGE?> </b><?
$queryStr = $pq.$dir.$queryfw.'&sa='.$showall.$qfid;
echo $fichiers->constructPageSelect($pgnum, $totalpgs, $queryStr);
?></td>
<? } ?>
</tr></table>
</form>