Robert Hess Download the code (2KB)
GEEK I have an Active Server Page with an input text box and a couple of command buttons that are ActiveX controls. The page takes user input and passes some values as parameters in a QueryString when the user clicks on the appropriate command button. In the onClick event of the control, the parameter values are assigned and the application navigates to the next page with the QueryString. No form method has been set. The problem is, if the Enter key is pressed, values get appended to the QueryString. Each time Enter is pressed, more values get appended to the QueryString. When the page finally gets submitted to its target page, a SQL error results from the incorrect number of parameters. How can I correct this? GEEK The fact that this is an ASP page is immaterial, since it sounds like the problem is occurring on the client. By the time this error is generated, all of the server scripting has been completed. Even the fact that you are using QueryString on the server to extract the values isnt an issue, since by the time you get back to the server to process the fetch, the damage has already been done. It sounds like the problem is that the URL you are constructing on the client is getting formed incorrectly. Without seeing your code, I really cant advise you on how to correct it. Id recommend that instead of doing something like
(or however it is that you are performing the "and the application navigates to the next page" functionality), you do
which will allow you to easily see the URL you are trying to go to. I expect you will see something like
which would indicate that you are continually appending information to the constructed URL, as opposed to simply updating internal variables that you would then use to better control the construction of the final URL reference.
There are a couple of ways you could do this, depending on how your page is laid out. Where your code currently does something every time the user presses Enter, you could update the appropriate values in some variables on your page. It might be easier to keep track of what QueryString values you want to use in <form> elements, and then extract the values from those form elements and construct the URL in one fell swoop when it finally is time to fetch the data.
GEEK I have an HTML form with two checkboxes that can be checked in any combination. Once the form is submitted to an Active Server Page, I want to perform certain actions depending on the state of each box (as determined through Request.QueryString). I understand that if the checkbox is unchecked, no data is passed to the ASP page, so I have written my VBScript code with that in mind. The problem is that I cannot get the value of the checkbox when it is passed in the string. I see in the URL
which would set a local Boolean value to reflect the status of the checkbox. Figure 1 is a sample page that illustrates this.
GEEK How can my application determine if it is supposed to use wide characters when saving text files and displaying text? What aspects of my application need to concern themselves with the differences between the character sets? What happens when a program that uses only ANSI/SBCS characters is run on a Far East version of Windows that uses DBCS? Are there any technical differences between the terms "wide characters" and DBCS or between "ANSI characters" and SBCS?
GEEK I copied the code in Figure 2 directly from the wave effect wizard on the Microsoft Web site. Why doesn't it work? One error I found is that phaseme is not defined again in phaseit. Once I added that in, I didn't get the script error, but the text is not animated as it is on the wizard.
this code should have done something like
which would have caused the phaseit function to be called repeatedly.
Of course, the animated waving of text is obnoxious and should be avoided except in situations where it truly adds value to the displayed page. And even then, you should allow the user to turn off the animation before they succumb to motion sickness. Figure 3 shows an updated version of this sample that allows the user to view animated text waving or turn it off. Example Online!
GEEK How can I reduce the number of colors in an image that I paste into Microsoft Image Composer 1.5? I want to create an image that can load quickly in any browser.
|