Displaying hidden variable values in text box on button click

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsegoy1979
    New Member
    • Jun 2008
    • 30

    #16
    Originally posted by hsriat
    It would be better if you post the generated HTML (the one which you see in the view source thingie)

    [HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head><title>
    Untitled Page
    </title>
    <script language="javas cript" type="text/javascript" >
    function DisplayHiddenVa lue()
    {
    //debugger;
    var theval = document.getEle mentById('hdnfl d').value;
    alert(document. getElementById( 'hdnfld').value );
    document.getEle mentById ('txtdisplay'). focus();
    var txtval= document.getEle mentById('txtdi splay').value +" "+ theval;
    // alert(txtval);
    document.getEle mentById('txtdi splay').value=t xtval;
    }
    </script>
    </head>
    <body>
    <form name="form1" method="post" action="TextBox Display.aspx" id="form1">
    <div>
    <input type="hidden" name="__EVENTTA RGET" id="__EVENTTARG ET" value="" />
    <input type="hidden" name="__EVENTAR GUMENT" id="__EVENTARGU MENT" value="" />
    <input type="hidden" name="__VIEWSTA TE" id="__VIEWSTATE " value="/wEPDwUKLTQwMTM3 OTkyOWRkiPXffNM TKaJE+dtXj9BK4x/GGq4=" />
    </div>

    <script type="text/javascript">
    <!--
    var theForm = document.forms['form1'];
    if (!theForm) {
    theForm = document.form1;
    }
    function __doPostBack(ev entTarget, eventArgument) {
    if (!theForm.onsub mit || (theForm.onsubm it() != false)) {
    theForm.__EVENT TARGET.value = eventTarget;
    theForm.__EVENT ARGUMENT.value = eventArgument;
    theForm.submit( );
    }
    }
    // -->
    </script>


    <script src="/CustomValidatio n/WebResource.axd ?d=0G1lpC1Mw-WqUmMptOtNRA2&a mp;t=6333669759 68750000" type="text/javascript"></script>

    <div>
    <table>
    <tr>
    <td>
    <textarea name="txtdispla y" rows="10" cols="20" id="txtdisplay" ></textarea>
    </td>
    </tr>
    <tr>
    <td>
    <a onclick="Displa yHiddenValue(); " id="lnkbtn" href="javascrip t:WebForm_DoPos tBackWithOption s(new WebForm_PostBac kOptions(&quot; lnkbtn&quot;, &quot;&quot; , false, &quot;&quot; , &quot;javascrip t:void(0)&quot; , false, true))">LinkBut ton</a>
    </td>
    <td>
    <input type="hidden" name="hdnfld" id="hdnfld" value="Diaspark " />
    </td>
    </tr>
    </table>
    </div>

    <div>

    <input type="hidden" name="__PREVIOU SPAGE" id="__PREVIOUSP AGE" value="6iXjEN7C VNX7ftfWFwReRvD YFE0SHoqpfcvm4F SeezQhthmN-wye2hVrn3EoP1md 0" />
    <input type="hidden" name="__EVENTVA LIDATION" id="__EVENTVALI DATION" value="/wEWBAKSn9TUCwLM vPSGAQLR2ZPSAQK Wlt2cDQdCdGeC/cVgAcyhuTLXmtRo s/n+" />
    </div></form>
    </body>
    </html>[/HTML]
    Last edited by acoder; Jun 25 '08, 02:25 PM. Reason: Added [code] tags

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #17
      hsegoy1979, please enclose your posted code in [code] tags (See How to Ask a Question).

      This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

      Please use [code] tags in future. Thanks!

      Comment

      • hsegoy1979
        New Member
        • Jun 2008
        • 30

        #18
        Thankx a lot

        I have done it

        Yogesh

        Comment

        • hsriat
          Recognized Expert Top Contributor
          • Jan 2008
          • 1653

          #19
          Originally posted by hsegoy1979
          Thankx a lot

          I have done it

          Yogesh
          That's really good. :)

          Comment

          Working...