|
Thank you so much for your excellent code. It is exactly what I want. I have been trying to figure this out for two days. You really saved me. Thanks for your great help.
|
|
|
|
|
I suppose you could save the caret pos, something like this:
var pos = TextArea1.caretPos;<br />
TextArea2.caretPos = pos;
I'm pretty sure this will work, but i'm not completely sure you can do this last step
good luck;)
---
http://sprdsoft.cmar-net.org - We Sprd You Softly
Our site features contents and several images.
Better check it out before the site grows even dumber.
|
|
|
|
|
It is not working in IE. I know to do this in NN is easy, just like one line of code. But in IE, it is something different.
var pos = TextArea1.caretPos;
pos will be "undefined" after this line of code.
Thank you very much.
|
|
|
|
|
Errr , this might seem silly, but have you tried anything like this:
var pos;<br />
pos = TextArea1.caretPos;
or even put var pos somewhere outside your function. I's worth a shot, considering IE's bug consistency..
Another thing, you might try checking out CP's discussion board page source when you're posting stuff, they're also using JS for textarea (or so it seems )
Good luck
---
http://sprdsoft.cmar-net.org - We Sprd You Softly
Our site features contents and several images.
Better check it out before the site grows even dumber.
|
|
|
|
|
Hi dudes,
i have a datagrid with checkbox, and i must read all the itens from it and put in a textbox using javascript...does anybody know how to do that?
Tks!!!
Rogerio Meneghelo Apezzatto
|
|
|
|
|
try to view the source of the HTML page, this will give you a clue on what the ID of the checkBox inside the GRID is.
Then document.all. will do the trick
"He that is good with a hammer tends to think everything is a nail." - Abraham Maslow
|
|
|
|
|
I am using an AJAX component to return an HTML select to the clients browser, inserting it into a div called DivSelect. At the moment, I have put this code in the body onload event. This was just for testing. What I would like to be able to do, is once the DivSelect is generated, to then call my function to load my select control. The reason for this is that my select control has about 100 records, and I would prefer to have my page show to the client quickly, and then inform them that the data is still loading.
So, is there an event I can use to fire this once the DivSelect control has been created on the client? Obviously I dont want any user interaction at this point, otherwise I would have just attached this event to a button.
While the above is performing, I would ideally like my static text in the DivSelect to display "Loading Data" with '.' being added until this gets to 3, then back to 0. Sorry about my explanation of this, I do not know how to describe it. So basically there will be four different text values for this, shown a second apart, eg. 'Loading Data', 'Loading Data .', 'Loading Data ..', 'Loading Data ...' - then back to the first one.
Please can you help me with this, or at least guide me in the right direction.
|
|
|
|
|
Hi there,
As you already know that the div tag does not support the onload event, so you cannot use it. The onreadystatechange event sounds helpful, but the div tag only raises this event when a behaviour is attached. In this case, there are two options come to mind:
+ You can place the script element containing your function right after the end tag of the div element. After the browser loads the div element, it will encounter the script tag and execute it, but you should remember that it does not execute the script if you only place the function definition in the script block.
+ Use the setInterval method to periodically check the existing of the div element, and call your function after it is loaded at the client side.
|
|
|
|
|
could someone tell me how www.wtf.com looks in there browser.
i want the infobar on my site but i first want to confirm that it doesnt screw up the page in different browsers.
i've tested it with ie 7.05 beta, opera 8.02, and firefox 1.04.
btw you can find out how to make that infobar here: http://blog.cs.cityu.edu.hk/users/50307104/ie/
|
|
|
|
|
If by 'infobar' you mean that 'it seems you are not registered' thing, it looks good but is pretty darn irritating. I don't know about other web users, but I really hate when site owners try to convince me I'm gonna die if I don't register with their site. I your site is really kool and offers quality stuff, I'm gonna register, infobar or no infobar..
Nice site though
---
http://sprdsoft.cmar-net.org - We Sprd You Softly
Our site features contents and several images.
Better check it out before the site grows even dumber.
|
|
|
|
|
oops theres a web development board =).
thats not my site i just wanted 2 c wat it looked like in different browsers b4 i use it on my site.
|
|
|
|
|
Allow me to repeat myself It looks good, but there's a good chance your users will not be as happy as you want them to be
---
http://sprdsoft.cmar-net.org - We Sprd You Softly
Our site features contents and several images.
Better check it out before the site grows even dumber.
|
|
|
|
|
Hi all,
I have a datagrid with a checkbox item in the header and i'm implementing a "select all" function which when select would select all other checkboxes on the form...
i am implementing the selectall function in javascript as such
function selectAll(obj)
{
if (obj.checked==true)
{
for(i=0; i<(document.forms[0].elements.length); i++)
{
...
all is working fine but i would like to change the text of the obj checkbox but i cant...
i tried obj.text = 'removeAll' but that doesnt work
any ideas?
|
|
|
|
|
A checkbox doesn't have any text. If there is text next to the checkbox, you have to find a way to access it separately.
---
b { font-weight: normal; }
|
|
|
|
|
Hi everyone,
I have a countChars function (javascript) for my textarea box: The functions uses a textarea, and textbox. User is only allowed to type up to "maxLength" characters in the textarea and the characters remaining is displayed in the textbox.
function countChars(controlToValidateRef, maxLength,outputControlRef, errorMessage, enableClientSideRestriction,showJavascriptAlert,showCharacterCount)
{
var countString = maxLength - controlToValidateRef.value.length;
if (countString < 0) {
if (enableClientSideRestriction) {
controlToValidateRef.value = controlToValidateRef.value.substring( 0, maxLength );
if (showJavascriptAlert) {
alert(errorMessage);
}
return false;
}
} else {
if (showCharacterCount) {
outputControlRef.value = countString;
}
}
}
I'm using this function for the following events (onkeyup,onChange,OnFocus,OnBlur) of the textarea
This works in every scenario, except when a user uses the browser to paste in text. Any way to detect this???
Thanks,
Paul
|
|
|
|
|
The OnBlur should help, cus this defenitely will be fired when the focus is lost on the control, and will fire the event.. This is what I used in one of my page only on the onblur event
<br />
function CheckLength(obj)<br />
{<br />
if (obj.value.length > 400)<br />
{<br />
window.alert("Length of Description should be less than 400")<br />
obj.focus()<br />
}<br />
}<br />
"He that is good with a hammer tends to think everything is a nail." - Abraham Maslow
|
|
|
|
|
I am setting up an English-language website on a system that mostly serves pages in Korean. Accordingly, when I hit the site, the server sends back headers like this:
Date: Mon, 22 Aug 2005 19:54:30 GMT
Server: Apache/2.0.49 (Unix) PHP/4.3.7
X-Powered-By: PHP/4.3.7
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=EUC-KR
Before displaying the page to my browser, Internet Explorer asks me if I want to install the Korean Language Pack. That's because of the Content-Type header, which specifies the Korean charset, which I don't have on my system.
This behavior isn't what I want, so I added a tag to the section of my page:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Unfortunately, this doesn't prevent the "Load Language Pack" popup from appearing. I cannot override the HTTP header with a <meta> tag.
Thinking I had found a bug in Internet Explorer, I quick went to the W3C, and what do you know? IE has it right: http://www.w3.org/TR/REC-html40/charset.html[^]:
conforming user agents must observe the following priorities when determining a document's character encoding (from highest priority to lowest):
1. An HTTP "charset" parameter in a "Content-Type" field.
2. A META declaration with "http-equiv" set to "Content-Type" and a value set for "charset".
3. The charset attribute set on an element that designates an external resource
Now this just seems plain wrong to me! Shouldn't fine-grain settings override global or course-grain settings? I think I should be able to specify a character set for an individual element, which overrides a page setting, which in turn overrides a "global" HTTP header. But no!
So my question is, can I specify character sets in this bottom-up fashion?
|
|
|
|
|
Hey all,
We have an option on our website to allow propects to download an evaluation copy of our software. In order for the the customer to install the software, they must input the proper activation keys which allow the software to run for 30 days.
Currently, when a prospect downloads the software, we have a .PHP script which email notifies Customer Support, who will then update our databases, and send the prospect an email with the activation codes.
We're finding this manual process to be a bit of a pain for obvious reasons (time zones primarily), and would like to goto a more automated system. I'm experienced in .PHP/.HTML .. (server supports .ASP too) But willing to venture down other avenues to solve our little problem. We would like a script to run that would generate an email with all the information they require to activate, without our interaction.
I'd prefer to keep the activation code generation in some kind of binary form, for security reasons. But I'm easily convinced of a better way.
Question: Does your company work in a similar way? How is this done? What would you recommend?
Any information/suggestions would be greatly appreciated.
Mike
|
|
|
|
|
I've never used PHP, but if PHP can call an executable and then get a result from it ( perhaps via a file on disk ? ) then I'm sure it can do what you want.
Personally, I'd use ASP.NET, but that's because I have, and I would never go back to asp, or any other pure scripting environment that doesn't give me native code and object orientated design.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have created one menu using javascript, after that I have put a dropdown combo of html but when menu drop down then dropdown combo will overlap to menu so how to put combo back side & menu upward side, give me a solution
anita
zzzzz
|
|
|
|
|
I already answered this question when you posted it two days ago.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I want to download a .csv file whenever user clicks on a button.
Can u help me.
Regards
Manikant Kasumwal
Software Engineer
R Systems International Ltd.
|
|
|
|
|
You can use the WebRequest class to download files from the web.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa,
i have gone through the WebRequest class but didn't find any method
to download a file.My requirment is when user click on a button it
should display a file download dialog box where user can choose the
location , just like we download any file from internet.
Thanks & Regards
Manikant
|
|
|
|
|
Aha, it's not you who will download the file, but the end user. That is something completely different.
Just link to the file, or use a button that redirects to the file:
<input type="button" value="Please don't click me." onclick="window.location='url to the file';">
---
b { font-weight: normal; }
|
|
|
|