javascript cookie + display in form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #16
    Oh right, you just needed to display on the screen. I thought you wanted to specifically display in a form. At least you got it working.

    Comment

    • 848lu
      New Member
      • Dec 2006
      • 37

      #17
      Originally posted by acoder
      Oh right, you just needed to display on the screen. I thought you wanted to specifically display in a form. At least you got it working.

      wow i was gonna post the same situation now...yes that is what i wanted at first, but realised its going to be kinda long so i just done it like this...

      now to show improvments on my assignment i have to show the same info in a layer....

      document.writel n("Confirmation ");
      document.writel n("<br/>");
      document.writel n("<br/>");
      document.writel n("Name: "+ Name );
      document.writel n("<br/>");
      document.writel n("<br/>");
      document.writel n("House no: "+ House);
      document.writel n("<br/>");
      document.writel n("Street: " +StreetName );
      document.writel n("<br/>");
      document.writel n("Postcode: "+ Postcode);
      document.writel n("<br/>");
      document.writel n("Contact No: "+ ContactNo );
      document.writel n("<br/>");
      document.writel n("Emergency No: "+ EmergencyNo);
      document.writel n("<br/>");
      document.writel n("<br/>");
      document.writel n("Card Details");

      document.writel n("<br/>");
      document.writel n("Card No.: "+ Card);
      document.writel n("<br/>");
      document.writel n("Expiry date: "+ expirydate);
      document.writel n("<br/>");
      document.writel n("Start date: "+ startdate);
      document.writel n("<br/>");
      document.writel n("Sort code: "+ sortcode);
      document.writel n("<br/>");
      document.writel n("Security no: "+ securityno);
      document.writel n("<br/>");
      document.writel n("Card type: "+ Cardtype);
      document.writel n("<br/>");


      i'm thinking the codes above won't work....damn i hate javascript man


      please help me moderator...... .

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #18
        To show information in a layer, put a div on the screen:
        [HTML]<div id="showData"> </div>[/HTML] then to make it easier just write the javascript within the page where you need it after the div.

        [HTML]<script type="text/javascript>
        // get the object
        var dataDiv = document.getEle mentById("showD ata");
        dataDiv.innerHT ML = ...//your data goes here[/HTML]

        Comment

        • 848lu
          New Member
          • Dec 2006
          • 37

          #19
          Originally posted by acoder
          To show information in a layer, put a div on the screen:
          [HTML]<div id="showData"> </div>[/HTML] then to make it easier just write the javascript within the page where you need it after the div.

          [HTML]<script type="text/javascript>
          // get the object
          var dataDiv = document.getEle mentById("showD ata");
          dataDiv.innerHT ML = ...//your data goes here[/HTML]
          i cant get this to work
          dataDiv.innerHT ML = ...
          can you give me an example

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #20
            Are you sure you've got the div object first using getElementById as I've shown above?

            Then:
            Code:
            dataDiv.innerHTML = "your string";
            should work fine, but remember that you have to have the div too. Show your code if you still have problems.

            Comment

            Working...