|
macca24 wrote:
What I want is that when the Web form is loaded that if the Ststus field contains the text "Closed" then the datepicker will disappear.
the code that will do the above trick
"He that is good with a hammer tends to think everything is a nail." - Abraham Maslow
|
|
|
|
|
SPS,
The page is blank above, I cannot see any code, can you check the posts you made, as I am unable to view any code you claim to have posted.
macca
|
|
|
|
|
Hi,
can someone recommend a tool to test a web server implementation?
Something to verify that your server implementation is RFC conform and reliable. I found it hard to test all the functionality with existing clients only (used web browsers and download managers). Also the HTTP 1.1 specification was quite hard to read (compared to HTTP 1.0), I would like to test properly. I am not terribly interested in stress and load testing at the moment, but as a first step I am more interested in reliability tests, being RFC conform and build up regresison tests.
Thanks!
|
|
|
|
|
Hello, there,
I'd like to know whether there is a way to get/set caret position in textarea control in Javascript. I tried very hard to seach the Internet and didn't find anything useful. Please help me out.
Here is an example of how I want it to work. Say I have two textarea boxes(TextArea1 and TextArea2) and a button. When the user clicks on the button, the text in the textArea1 is copied to textarea2, textarea1 lose focus and textarea2 will get the focus. All these are very easy to implement. But what I want is the caret in the TextArea2 set to the position of caret position in TextArea1 before the button click.
Please help me.
Thank you very much in advance.
Bin
|
|
|
|
|
|
Can you give me some details? I knew use TextRange too.
|
|
|
|
|
Here's a little example:
<html>
<head>
<script>
function DoTheCopy()
{
var one = document.getElementById("FirstTextArea");
var two = document.getElementById("SecondTextArea");
one.focus(); // so cursor isn't on button just pressed
var range1 = document.selection.createRange();
var range2 = document.body.createTextRange();
range2.moveToElementText(one);
// count distance from start
var startDist = 0;
while (range1.compareEndPoints("StartToStart", range2) > 0)
{
++startDist;
range1.moveStart("character", -1);
}
// count distance from end
var endDist = 0;
while (range1.compareEndPoints("EndToEnd", range2) < 0)
{
++endDist;
range1.moveEnd("character", 1);
}
// duplicate text and selection in second text area
two.value = one.value;
var newRange = two.createTextRange();
newRange.moveStart("character", startDist);
newRange.moveEnd("character", -endDist);
newRange.select();
}
</script>
</head>
<body>
<textarea id="FirstTextArea">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
</textarea>
<button onclick="DoTheCopy()">Copy</button>
<textarea id="SecondTextArea">
</textarea>
</body>
</html>
You must be careful in the forest
Broken glass and rusty nails
If you're to bring back something for us
I have bullets for sale...
|
|
|
|
|
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
|
|
|
|
|