Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing button's caption on click
Message
 
 
To
14/02/2003 18:00:16
Fabian Belo
Independent Developer
Argentina
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00752305
Message ID:
00753621
Views:
18
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):
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<form name="frm1" >


<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>
<P align = center><Font Size = 6><b>HTTP Server Variables<b></font></P>
<center>
<table border = 1>
<tr><TH>Variable</TH><TH>Value</TH></TR>
<% @language = JavaScript %>
<% // Create new Enumerator object
   http = new Enumerator(Request.ServerVariables)
   // iterate through collecion
   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>
  </center>   
  <P>  
   <% if (Request.ServerVariables("HTTP_COOKIE")!=="") {
        Response.Write ("Browser supports cookie!")}
     else {
        Response.Write ("Browser does not support cookie!")}
     %> </P>
  <P>
 
  <% Response.Cookies("verifycookie") = "True" 
 
   If (Request.Cookies("verifycookie") == "True" ) {
      Response.Write ("Browser supports cookie!")}
   else {
     Response.Write ("Browser does not support cookie!")}
 %>

  </P>
</BODY>
</HTML>

<script Language=vbScript>
sub cmdButton_OnClick()
	if frm1.cmdButton.value = "Button" then
		frm1.cmdButton.value = "Hello" 
		frm1.cmdButton.statusbartext = "Test test" 'this doesn't work - who can help me with statusbar?
	else
		frm1.cmdButton.value = "Button"
	end if
end sub	

</script>
>Sorry. I'm not good in JS. Actually I avoid JS as much as I can (not overload client's side)
>
>>Ok, I can not get your code to work in Java script
>>
>><% Response.Cookies("verifycookie") = "True"
>>
>>   If (Request.Cookies("verifycookie") == "True" ) {
>>      Response.Write ("Browser supports cookie!")}
>>   else {
>>     Response.Write ("Browser does not support cookie!")}
>>
>>
>>
>>Error Type:
>>Microsoft JScript compilation (0x800A03EC)
>>Expected ';'
>>/nadyatest/buttonchange.asp, line 42, column 47
>>If (Request.Cookies("verifycookie") == "True") {
>>
>>What's wrong here?
>>>>Error Type:
>>>>Microsoft JScript runtime (0x800A138F)
>>>>'Request.Browser.Cookies' is null or not an object
>>>>/nadyatest/buttonchange.asp, line 39
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