Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing button's caption on click
Message
 
 
To
15/02/2003 11:09:02
Fabian Belo
Independent Developer
Argentina
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00752305
Message ID:
00756684
Views:
14
Hi Fabian,

Just came across to this link and want to share http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=29

BTW, your code worked, but I didn't figure out, what's wrong in mine. I asked this question to Vlad G and on the tek-tips forum, but didn't get a reply...

And this one explaining, that your approach is incorrect:
http://www.asp101.com/articles/john/cookiedetect/default.asp

>Nadya:
>I've added some tags and changed the way to verify cookies. Works perfectly. Compare the following code with your to see the differences and to handle "statusbar" is: window.status, is not a part of the form (frm1)
>Good luck!
>
>
><% @language = JavaScript   
>
><HTML>
><HEAD>
><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
><TITLE></TITLE>
></HEAD>
><BODY>
><form name="frm1" >
><br><br><br>
><INPUT  type="button" id=cmdButton name=cmdButton value="Button"
>title="There are five Mondays in every work week" style="LEFT: 100px; WIDTH:
>50px; POSITION: absolute; TOP: 10px" CHECKED>
>
></form>
><HTML>
><HEAD><TITLE>HTTP Server Variables</TITLE>
></HEAD>
><BODY>
>  <P ALIGN=CENTER><FONT SIZE=5><B>HTTP Server Variables</B></FONT></P>
>  <center>
>  <TABLE BORDER>
>  <TR><TH>Variable</TH><TH>Value</TH></TR>
>
> <%
>    // create new Enumerator object
>    http = new Enumerator(Request.ServerVariables)
>    
>  <%
>    // iterate through collection
>    while (!http.atEnd(http))
>    {
>      // get one item
>      i = http.item();
>      // show it and it's value
>      Response.Write('<TR><TD>' + i + '</TD><TD>' +
>                           Request.ServerVariables(i) + '</TD></TR>')
>      // get next item
>      http.moveNext()
>    }
>    
>  </TABLE>
></BODY>
></HTML>
><script language=Javascript>
>var cookieName = 'testCookie' + (new Date().getTime());
>   document.cookie = cookieName + '=cookieValue';
>   var cookiesEnabled = document.cookie.indexOf(cookieName) != -1;
>   if (cookiesEnabled)
>     document.write("Cookies Enabled");
>   else
>     document.write("Cookies Disabled");
>
></script>
>
><script Language=vbScript>
>sub cmdButton_OnClick()
>	if frm1.cmdButton.value = "Button" then
>		frm1.cmdButton.value = "Hello"
>		window.status = "Test test"
>	else
>		frm1.cmdButton.value = "Button"
>	end if
>end sub	
>
></script>
>
>
>>I just don't understand it. The above similar code works, but this one doesn't. I'm missing the obvious and it's getting on me...
>>
>>Here is the full text of this test ASP page (buttonchange.asp):
>>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform