Placement du curseur

Eléphant du PHP | 168 Messages

06 avr. 2005, 11:18

Comment faire pour mettre le curseur automatiquement sur le premier champs a saisir
(en php de pref)
merci
Tous les hommes aspirent à être heureux, mais personne ne s'entend sur la définition du bonheur.
Celui qui a un ami véritable n'a pas besoin d'un miroir.

Avatar du membre
ViPHP
ViPHP | 3008 Messages

06 avr. 2005, 11:42

loooooooooool mais tu poses la même question ! :lol: le javascript que je t'ai donné n'est pas bon ?

Eléphant du PHP | 168 Messages

06 avr. 2005, 11:45

je n'arrive pas a l'executer
:lol:
n'existe t il pas une fonction similare en php, par hasard?
ps:bonne appetit a vous qui lirez ce message
Tous les hommes aspirent à être heureux, mais personne ne s'entend sur la définition du bonheur.
Celui qui a un ami véritable n'a pas besoin d'un miroir.

ViPHP
ViPHP | 2144 Messages

06 avr. 2005, 11:51

pikachu639 : Prends la peine de lire les rêgles des forums STP :wink: :wink: :wink:

Avatar du membre
ViPHP
ViPHP | 3008 Messages

06 avr. 2005, 11:52

bizarre lol, en php je ne sais pas mais la fonction javascript fonctionne très bien...

Je viens de le tester :

Code : Tout sélectionner

<form name="form"> <input type="Text" name="nom"> <script language="JavaScript"> document.form.nom.focus(); </script> </form>
Tu es sûre de ne pas avoir oublié de nommer ton form et ton champs ?

Eléphant du PHP | 168 Messages

06 avr. 2005, 11:55

j'essai et je te redis ca
Tous les hommes aspirent à être heureux, mais personne ne s'entend sur la définition du bonheur.
Celui qui a un ami véritable n'a pas besoin d'un miroir.

Eléphant du PHP | 168 Messages

06 avr. 2005, 14:31

visible ca ne va pas dans mon code ca our ien du tout c'est la meme chose
Tous les hommes aspirent à être heureux, mais personne ne s'entend sur la définition du bonheur.
Celui qui a un ami véritable n'a pas besoin d'un miroir.

Avatar du membre
ViPHP
ViPHP | 3008 Messages

06 avr. 2005, 14:32

mmmmhhh c'est très bizarre tout ça. Tu as un code à me montrer ? c'est aps normal que ça ne fonctionne pas, sauf si peut-être tu as désactivée le javascript...

Eléphant du PHP | 168 Messages

06 avr. 2005, 14:39

voila le code c'est un truc ds le genre
<html>
<head>
	<title>AJOUT D'UNE MACHINE</title>
</head>
<body>
<br>
<h2 align=center> AJOUTER UNE MACHINE </H2>
<BR>
<form method="post" action="page4_2.php">
<?
$img_fond="image_fond/1.jpg";
$img_fond_lar="100%";
$img_fond_haut="100%";
echo"<BODY BGCOLOR=\"blue\" TEXT=\"white\" LINK=\"white\" VLINK=\"white\" ALINK=\"white\" 
WIDTH=\"$img_fond_lar\" HEIGHT=\"$img_fond_haut\" BACKGROUND=\"$img_fond\" >";
?>
<table border=0 align=center width=330 CELLSPACING=0><tr>
	<td width=50%><p>Nom de l'utilisateur</td>
	<td width=50%><p><input type=text name=nom></td>
</tr>
<tr>
	<td width=50%><p>Nom de la machine</td>
	<td width=50%><p><input type=text name=machine></td>
</tr>
<tr>
	<td width=50%><p>Vitesse</td>
	<td width=50%><p><input type=text name=vitesse></td>
</tr>
<tr>
	<td width=50%><p>IP</td>
	<td width=50%><p><input type=text name=ip ></td>
</tr>
<tr>
	<td width=50%><p>MAC</td>
	<td width=50%><p><input type=text name=mac ></td>
</tr>
<tr>
	<td width=50%><p>Systeme d'exploitation</td>
	<td width=50%><p><input type=text name=os ></td>
</tr>
<tr>
	<td width=50%><p>Localisation</td>
	<td width=50%><p><input type=text name=localisation></td>
</tr>
<tr>
	td height=20></td>
	<td height=20></td>
</tr>
<tr>
	<td width=135 align=center valign=center><input type=submit name=expedier value=Envoyer></td>
	<td width=126 align=center valign=center><input type=reset name=annuler value=Annuler></td>
</tr>
</table>
<br>
<?
$lien1="./page2.php";
$text1="accueil";
$lien2="./index.php";
$text2="sortir";
echo"<table width=100%>";
echo"<tr>";
echo"<td width=25% align=left></td>";
echo"<td width=50% align=center>";
echo"<b><a href=\" $lien1\">$text1</a> <br /></b>";
echo"</td>";
echo"<td width=25% align=right>";
echo"<b><a href=\" $lien2\">$text2</a> <br /></b>";
echo"</td></tr></table>";
?>
</form>
</body>
</html>
Tous les hommes aspirent à être heureux, mais personne ne s'entend sur la définition du bonheur.
Celui qui a un ami véritable n'a pas besoin d'un miroir.

Avatar du membre
ViPHP
ViPHP | 3008 Messages

06 avr. 2005, 14:47

Si c'est ce code que tu utilises, c'est normal que ça ne fonctionne pas...ton formulaire n'est pas nommé.

Donc en gros ça doit être :
<html> 
<head> 
    <title>AJOUT D'UNE MACHINE</title> 
</head> 
<body> 
<br> 
<h2 align=center> AJOUTER UNE MACHINE </H2> 
<BR> 
<form method="post" action="page4_2.php" name="nom_form"> 
<? 
$img_fond="image_fond/1.jpg"; 
$img_fond_lar="100%"; 
$img_fond_haut="100%"; 
echo"<BODY BGCOLOR=\"blue\" TEXT=\"white\" LINK=\"white\" VLINK=\"white\" ALINK=\"white\" 
WIDTH=\"$img_fond_lar\" HEIGHT=\"$img_fond_haut\" BACKGROUND=\"$img_fond\" >"; 
?> 
<table border=0 align=center width=330 CELLSPACING=0><tr> 
    <td width=50%><p>Nom de l'utilisateur</td> 
    <td width=50%><p><input type=text name=nom>
	<script language="JavaScript"> 
		document.nom_form.nom.focus(); 
	</script></td> 
</tr> 
<tr> 
    <td width=50%><p>Nom de la machine</td> 
    <td width=50%><p><input type=text name=machine></td> 
</tr> 
<tr> 
    <td width=50%><p>Vitesse</td> 
    <td width=50%><p><input type=text name=vitesse></td> 
</tr> 
<tr> 
    <td width=50%><p>IP</td> 
    <td width=50%><p><input type=text name=ip ></td> 
</tr> 
<tr> 
    <td width=50%><p>MAC</td> 
    <td width=50%><p><input type=text name=mac ></td> 
</tr> 
<tr> 
    <td width=50%><p>Systeme d'exploitation</td> 
    <td width=50%><p><input type=text name=os ></td> 
</tr> 
<tr> 
    <td width=50%><p>Localisation</td> 
    <td width=50%><p><input type=text name=localisation></td> 
</tr> 
<tr> 
    <td height=20></td> 
    <td height=20></td> 
</tr> 
<tr> 
    <td width=135 align=center valign=center><input type=submit name=expedier value=Envoyer></td> 
    <td width=126 align=center valign=center><input type=reset name=annuler value=Annuler></td> 
</tr> 
</table>
<br> 
<? 
$lien1="./page2.php"; 
$text1="accueil"; 
$lien2="./index.php"; 
$text2="sortir"; 
echo"<table width=100%>"; 
echo"<tr>"; 
echo"<td width=25% align=left></td>"; 
echo"<td width=50% align=center>"; 
echo"<b><a href=\" $lien1\">$text1</a> <br /></b>"; 
echo"</td>"; 
echo"<td width=25% align=right>"; 
echo"<b><a href=\" $lien2\">$text2</a> <br /></b>"; 
echo"</td></tr></table>"; 
?> 
</form> 
</body> 
</html>
Avec ça ça devrait marcher. :wink:

Eléphant du PHP | 168 Messages

06 avr. 2005, 14:55

Ca marche merci du coup de main
J'ai juste un peu aranger ton code GSPR que tu ne m'en voudra pas
:lol:
Tous les hommes aspirent à être heureux, mais personne ne s'entend sur la définition du bonheur.
Celui qui a un ami véritable n'a pas besoin d'un miroir.

Avatar du membre
ViPHP
ViPHP | 3008 Messages

06 avr. 2005, 14:56

loool c'est ton code, tu en fais ce que tu veux ;) bonne continuation !

Au fait ça veut dire quoi : GSPR ? que je ne dorme pas bête ce soir lol

Eléphant du PHP | 168 Messages

06 avr. 2005, 15:05

c'est gentil
GSPR = j'espère
comme ca on sera deux a ce couché moin bete lol
Tous les hommes aspirent à être heureux, mais personne ne s'entend sur la définition du bonheur.
Celui qui a un ami véritable n'a pas besoin d'un miroir.

Avatar du membre
ViPHP
ViPHP | 3008 Messages

06 avr. 2005, 15:07

loool j'avais pas tilté :)
A++