IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VBScript Discussion :

ajouter un element dans un html ou hta


Sujet :

VBScript

  1. #1
    Inactif  

    Homme Profil pro
    cuisiniste
    Inscrit en
    Avril 2009
    Messages
    15 374
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : cuisiniste
    Secteur : Bâtiment

    Informations forums :
    Inscription : Avril 2009
    Messages : 15 374
    Billets dans le blog
    8
    Par défaut ajouter un element dans un html ou hta
    bonjour a tous

    comment ajoute t-on un element dans une page html ou hta (image,text )

    jai bien trouver "document.write" mais sa supprime tout ce qui etait avant


    une idée??


    au plaisir
    mes fichiers dans les contributions:
    mail avec CDO en vba et mail avec CDO en vbs dans un HTA
    survol des bouton dans userform
    prendre un cliché d'un range

    si ton problème est résolu n'oublie pas de pointer : : ça peut servir aux autres
    et n'oublie pas de voter

  2. #2
    Expert confirmé
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 843
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 843
    Par défaut
    voila un extrait de code qui est incomplet bien sûr mais peut-être il te donne une petite idée. dans ce code j'ai utilisé quelques emoticons de developpez.net
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    <html>
    <head>
    <HTA:APPLICATION 
        ICON="icon.ico"
        APPLICATIONNAME = "SMTP Mail Client" 
        BORDER="dialog"
        BORDERSTYLE="complex"
        CONTEXTMENU="no"
        SYSMENU="yes"
        MAXIMIZEBUTTON="no"
        SCROLL="no" 
    >
    <style type="text/css">
    input.button {  background-color : #EFEFEF;
    				color : #000000; cursor:hand;
    				font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; }
    input.longbt {  background-color : #EFEFEF;
    				color : #000000;
    				font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; width:100px}
    </style>
    <script language="VBScript">
    Sub Save(var)
    Select Case var
    	Case 0
    id("SaveRes").innerhtml = "<br><span class=""gensmall"">Saving to: </span><span id=""FolderPath"">" & SaveFolder & "</span>" _
    		& VbCrlf & "<input type=""text"" name=""FileName"" size=""60"" >" _
    		& VbCrlf & "<input name=""BtnSave2"" onclick=""Save(1)"" type=""button"" value=""Save"" class=""button"">" _
    		& VbCrlf & "<input name=""BtnChangeFolder"" onclick=""Save(2)"" type=""button"" value=""Choose Folder"" class=""longbt"">" _
    		& VbCrlf & "<input name=""BtnSave2"" onclick=""Save(5)"" type=""button"" value=""Cancel"" class=""button""><br>"
    		Case 5
    	id("SaveRes").innerhtml = ""
    Case 6
     
    id("SaveRes").innerhtml = "<br><span class=""gensmall""></span><span id=""FolderPath"">" & SaveFolder & "</span>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/salut.gif  http://www.developpez.net/forums/images/smilies(':salut:')  alt=:salut:>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_biggrin.gif  OnClick=emoticon(':D')        alt=Very Happy>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_smile.gif    OnClick=emoticon(':)')        alt=Smile>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_sad.gif      OnClick=emoticon(':(')        alt=Sad>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/chin.gif      OnClick=emoticon(':koi:')     alt=what>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_eek.gif      OnClick=emoticon(':shock:')   alt=Shocked>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_confused.gif OnClick=emoticon(':?')        alt=Confused>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/ccool.gif     OnClick=emoticon('8)')        alt=Cool>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_lol.gif      OnClick=emoticon(':lol:')     alt=Laughing>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/sm.gif      OnClick=emoticon(':x')        alt=Mad>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_razz.gif     OnClick=emoticon(':P')        alt=Razz>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_redface.gif  OnClick=emoticon(':oups:')    alt=Embarassed>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_cry.gif      OnClick=emoticon(':cry:')     alt=Crying or Very sad>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_evil.gif     OnClick=emoticon(':evil:')    alt=Evil or Very Mad>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_twisted.gif  OnClick=emoticon(':twisted:') alt=Twisted Evil>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_wink.gif    OnClick=emoticon(':wink:')    alt=Wink>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_exclaim.gif  OnClick=emoticon(':!:')       alt=Exclamation>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/desesp.gif   OnClick=emoticon(':desesp:')  alt=desesp>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_idea.gif    OnClick=emoticon(':idea:')       alt=Idea>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_arrow.gif    OnClick=emoticon(':arrow:')   alt=Arrow>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_neutral.gif  OnClick=emoticon(':|')        alt=Neutral>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/kiss.gif     OnClick=emoticon(':kiss:')    alt=kiss>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/pan.gif    OnClick=emoticon(':ccool:')   alt=ccool>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/hola.gif     OnClick=emoticon(':hola:')    alt=hola>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/buttons/resolu.gif   OnClick=emoticon(':resolu:')  alt=resolu>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/furieux.gif  OnClick=emoticon(':furieux:') alt=furieux>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/sacrain.gif  OnClick=emoticon(':sacrain:') alt=sacrain>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/icon_bug.gif      OnClick=emoticon(':bug:')     alt=bug>"_
    & VbCrlf &"<img src=http://www.developpez.net/forums/images/smilies/merci.png    OnClick=emoticon(':merci:')   alt=merci>"_
    & VbCrlf &"<center><input name=""BtnSave2"" onclick=""Save(5)"" type=""button"" value=""Cancel"" class=""button""><br>"_
    & VbCrlf &"<img src=http://photomaniak.com/upload/out.php/i1102064_IDNlogo.gif></center>"
     
    Case 7
    id("SaveRes").innerhtml = "<center><h4 style='color:Red'>Type your Gmail Adress </h4>"_
            & VbCrlf &"<input type=""text"" name=""GmailLogin"" id=""GmailLogin"" size=""30"" value=""GmailAccount@gmail.com"" >"_
            & VbCrlf &"<h4 style='color:Red'>Type your Gmail Password </h4>"_
            & VbCrlf &"<input type=""password"" name=""GmailPassword"" id=""GmailPassword"" size=""30"" ><br><br>"_
            & VbCrlf &"<input name=""BtnSave2"" onclick=""SendViaGmail()"" type=""button"" value=""SEND WITH YOUR GMAIL ACCOUNT"" class=""button""><br>"_
            & VbCrlf &"<br><img src=http://photomaniak.com/upload/out.php/i1102064_IDNlogo.gif></center>"_
            & VbCrlf &"<input name=""BtnSave2"" onclick=""Save(5)"" type=""button"" value=""Cancel"" class=""button""><br>"
    	End Select
    End Sub
     
    Function id(o)
    Set id = document.getElementById(o)
    End Function
    </script>
    </head>
    <body>
    <input name="BtnSave2"  type="button" class="longbt" value="Save as..." onclick="Save(0)"><span id="SaveRes"></span>
    <input name="BtnSave2"  type="button" class="longbt" value="Emoticons" onclick="Save(6)"><span id="SaveRes"></center></span><br>
    <input name="BtnSave2"  type="button" class="longbt" value="Gmail" onclick="Save(7)"><span id="SaveRes"></center><br></span>
    </body>
    </html>

  3. #3
    Inactif  

    Homme Profil pro
    cuisiniste
    Inscrit en
    Avril 2009
    Messages
    15 374
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : cuisiniste
    Secteur : Bâtiment

    Informations forums :
    Inscription : Avril 2009
    Messages : 15 374
    Billets dans le blog
    8
    Par défaut re
    bonjour hackoofr

    si je comprends bien ton code tu réécris les boutons ????

    c'est un peu mon problème je dois avoir une centaine d'éléments sur ma page ça risque d'être un peu difficile

    si je n'ai pas bien compris
    pourrais tu me faire un exemple avec un seul ajout pour que je puisse comprendre


    merci a toi

    au plaisir
    mes fichiers dans les contributions:
    mail avec CDO en vba et mail avec CDO en vbs dans un HTA
    survol des bouton dans userform
    prendre un cliché d'un range

    si ton problème est résolu n'oublie pas de pointer : : ça peut servir aux autres
    et n'oublie pas de voter

  4. #4
    Inactif  

    Homme Profil pro
    cuisiniste
    Inscrit en
    Avril 2009
    Messages
    15 374
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Var (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : cuisiniste
    Secteur : Bâtiment

    Informations forums :
    Inscription : Avril 2009
    Messages : 15 374
    Billets dans le blog
    8
    Par défaut re
    bonsoir hackoofr

    après m'être promené sur le net
    je commence a comprendre
    donc utilisé le "innerhtml"
    si j'ai bien compris
    je met un div id="machinchose" vide dans ma page
    je le récupère avec le "innerhtml" et je le modifie
    est bien ça le procédé de base???

    merci pour le coup de main

    au plaisir
    mes fichiers dans les contributions:
    mail avec CDO en vba et mail avec CDO en vbs dans un HTA
    survol des bouton dans userform
    prendre un cliché d'un range

    si ton problème est résolu n'oublie pas de pointer : : ça peut servir aux autres
    et n'oublie pas de voter

Discussions similaires

  1. [Tkinter] Ajouter un element dans OptionMenu
    Par t_om84 dans le forum Tkinter
    Réponses: 12
    Dernier message: 29/05/2008, 17h46
  2. Pb d'ajout d'element dans un liste
    Par profx dans le forum Général JavaScript
    Réponses: 17
    Dernier message: 27/02/2007, 17h49
  3. ajouter un element dans un formulaire
    Par jojo57 dans le forum Access
    Réponses: 5
    Dernier message: 13/04/2006, 22h18
  4. comment ajouter une image dans mon HTML??
    Par Mickey.jet dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 22/03/2006, 15h12
  5. Réponses: 12
    Dernier message: 26/02/2003, 08h14

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo