Instead of searching and replacing unwanted character in strings using cgi/perl, I would like to prevent some characters from ever being typed in text boxes and textfields. Two characters I would like to stop are "|" (pipe symbol) and the "carriage return". I am not even sure how to search and/or replace a carriage return in a string anyway. This may be a JavaScript function, because what I would really like to do is send an alert to tell the user that it is not allowed.
In a web based form I am able to make sure that there is text in an input field but I want to restrict the user from using such characters as ~ # & '
How can I modify this JavaScript below to enable this ?
if (document.form1.ProjectTitle.value == ""){ alert("Please complete the Project Title: field") document.form1.ProjectTitle.focus() validFlag = false return validFlag }
When entering the project title into another system it issues an error when those characters are input - hence the need to delete them from the request.
I have an email which has some values attached to a link in the email that get passed to an online form on a website when clicked. Problem is the value is a price and the string includes a "$" which I need to remove. I've read through many examples and everyone seems to have an opinion (surprise). One suggests something like this: text2.value=text1.value.replace(/$/g,""); While someone else says its better to remove what you don't want. I am also scratching my head over should I place the value into a hidden field, scrub it then copy that into the proper field? and I imagine the best way would be to run it with an "onload" command instead or a event handler like a keystroke since the field is not typed?
I have used a javascript inside the bottom of the page, I am not able to get why the unwanted gap is coming, can we resolve this without removing the javascript,
I don't know if it was some kind of "upgrade" in a recent Windows SP but, I now have a problem...When ever I have JavaScript open a new window the URL is displayed in the title bar prior to the title, this is really just an aesthetic problem but seems to be fixed if I set the new window property of location to yes, but I then get an ugly url title bar in my new window. Does anyone know how to disable that "feature" or even what I am talking about. It just annoys me.
I just have one index.html page with NO links NO pics. Just a simple html page.
Whenever I open that page I want to eliminate few things like:
I don't want scroll bar -> I have a solution <body scroll="no"> I don't want status bar -> ? need solution ? I don't want toolbar bar -> ? need solution ? I don't want menu bar -> ? need solution ?
I JUST want the title bar, address bar and the IE window.
I'm working with 3 Frames on a web-page: (top) Top.html, (left) Navigation.html, and (right) "Content" which contains varying html pages based on the (left) Navigation Selection - the problem that I'm having is that each frame has a (approx.) 2 pixel border around it... I want the frames to blend seamlessly on the page. I'm not sure How and Where to set the Border attribute to 0 - is it in the Frameset Definition (which I thought I took care of with frameborder="0") or in the actual html pages that populate the Frames? If so, where do I include the attribute? Code:
I'm using mouseenter and mouseleave to call a slideToggle on a dropdown menu. What's bothering me though is if my mouse moves in and out of the menu a few times before the toggle animation is complete and replays the open close a few times before stopping. [URL]... Is there a way to kill the queue so that it doesn't play if the mouse is not over it anymore?
This is probably more of an HTML question than anything else, so my apologies if it's out of place.I'm using a series of spans within a div to act as filters (selectors) to hide/show various divs. When the user clicks on the text within the span, the span toggles a "selected" class, and also triggers a function to hide the associated divs. My problem is that occasionally the area around the text (the entire span, it would seem) gets "selected" when clicked on and turns blue, obscuring the text. Here are two screenshots, one showing the word "lambs" correctly, the other showing the same word with the unwanted blue background. Question: is there any way to make this not happen? Should I be using different elements as the selectors?
My page is not displaying correctly in Internet Explorer. Its displays properly in all other browsers.
The issue: Internet Explorer
When the page is loaded-- Internet Explorer places DIV tags between the the <LI> elements on my page and in other areas of the controls which have been dynamically added to a placeholder on the child form during page load. The first <UL> element on the list has an ID assigned. The java-script functions correctly on the first <LI> element but does not get to the rest as <DIV> tags have been placed between them breaking up the nodes.
Opera, Safari, Chrome and Firefox load these controls without separating the elements with additional DIV tags. They remain grouped together and display as intended. As they remain in the proper UL container my Java-Script can collapse the list as designed by getting the child elements of the UL.
I am having problems with the code below (obviously) coming up with illegal character for various characters within the field name which is: S_Gift Finder1_0
I have tried various ways of escaping the characters but to no avail.
I am unable to change the name of the field as it it comes from an external off-the-shelf package. Code ....
I have character counter for textarea wich counting the characters. Special character needs same place as two normal characters because of 16-bit encoding.
Counter is counting -2 when special character is added like some language specific char.
I'm currently following this tutorial on loading pages with Ajax:[url]...
For some reason when a new page is loaded via Ajax by clicking a link on the left-hand navigation, the new content returned has a large gap that appears on its left-hand side. My question is what's causing this and how can it be fixed?There's not much in the source, so reading the code shouldn't be difficult.
My example code causes the following problem in Internet Explorer (at least, in version 6): it causes an unwanted cursor change when the button is clicked. DETAILS: Using my example code, here is what happens (step-by-step in chronological order): (1) the user hovers the mouse over the button, which causes the cursor to be a hand; (2) the user clicks the button; (3) the browser does its image-related activity; (4) immediately after step 3 is entirely completed (in other words, after the browser finishes loading an available image or after the browser times out from attempting to find an unavailable image), the cursor changes from a hand to an arrow if the mouse is kept still; (5) if the mouse is then moved while staying over the button, the cursor will change back to a hand.
As I said, in step 4, the cursor changes from a hand to an arrow if the mouse is kept still. I consider that to be a problem because I want the cursor to *always* be a hand when it is over the button. And, indeed, that should be the expected behavior due to the CSS code (style="cursor:pointer") in the button tag.
QUESTION #1: The problem occurs in IE6, which is the only version of IE available to me. Does the problem also occur in later versions of IE? (The problem does not occur in Firefox.)
I am having a problem with a site I am working on right [URL]..clicking on the "Kontaktieren Sie uns"-Link it triggers an unwanted scroll in the slider just underneath it. I am also getting a java script error when I view the site on ie/windows. I am clueless since I am not at all confident with java script.
Here's a demo of the work I have at the moment: [url]
Basically if you click on "Blog" in the main navigation column, a second column next to it will Ajax loads "blog.html" that contains a list of "posts." If you click on one of the posts in the second column, a third column will load in with the content of the post.
While that's working fine, if you click "Blog" again, this is where the script goes haywire. Firebug shows over 20 GET requests on the second column. And then when you click on a link in the second column after that, an equal amount of GET requests is sent. You can even see the animations going crazy. I have no idea why this is happening.
It started to occur when I added the following lines to mainnav.js:
The reason why I added this was because I wanted to show the full slide out animation before the script Ajax loads another blog.html when "Blog" is clicked for the second time. Before I implemented the code above and loadContent function, the problem was that the slide out animation was cut off by the loading of the page. To prevent this, I thought using a callback function would work since callbacks occur after the animation is completed.
The only issue with this is that if you first load the page #listnav has no child elements. Therefore if you try using the following code:
...the callback function is never executed since there are no nav li elements until you click "Blog." That's why I tried to implement an if statement which checks if there are elements within #listnav, and it works fine on the first click, but any clicks after the script just bugs out.
I have a Java GUI application where I perform a lot of long DB operations [e.g. massive SQL Insert's], which takes 5-60 secs to perform. Sometimes user double-clicks the button or just gets impatient and clicks again, which created duplicate records.
So I am trying to disable the button as soon as it is clicked, and as soon as it's done, re-enable it again.
I tried to do it in Javascript, just simple: <input... name=Save... onclick="enabled=true;"> and as soon as screen refreshes, it re-enables the button automatically.
That works in some cases, however when I need to do some other Javascript operation (e.g. validate() the fields on the screen), disabling the button automatically stops both Javascript and association form action in Java which is totally unacceptable.
Is there any other simple solution to such problems in Java or Javascript?
I have an <input> box and i want to disable the apostrophe ( ' ) key, so when you press it, no character appears in the input box. All other keys should work ok.
I can trap the keypress event using "onkeypress=myKeypressHandler()" but, beyond that, I'm stuck. I forget how to detect what key was pressed or how to "null it out".
I'm using IE6 and users will be IE5.0 upward ONLY (trust me on this, suffice to say it's not a website but an intranet application).
I need to html encode all text field values on the client just before sending them to the server. A javascript equilalent of Server.HTMLEncode in IIS. I also need to be able to perform the reverse.
All I am trying to do is ensure that if a user enters html tags in the a form, that the tags does not get parsed by the browser.
I have a colour picker on my site, see it at [URL]Now I want to change the colour of the links on the page, don't worry I know how to do all this.
It's just if someone chooses full black (#000000) the theme looks awesome, but the links on the dark background are invisible.
Similarly if someone chooses full white (#ffffff) then you can't see the text on the white background.
So I want to know if you geniuses can make it so when a variable containing a hex, like #000000 is set as the main colour, then the link colour is changed to #666666 so you can still see it, but I want it to work with colours, so if you had #360000 (dark red) then the link colour would be something like #a10000.
I hope I have explained it well enough for you to understand, here is my code to change the background:
If a negative number is entered into the reading variable it should be displayed as a zero. This works with the first calculations such as average but right at they very end the the alert wont display the highest average it just displays the one which has a negative number typed in to it.
I'm trapping the onKeyPress event of a textarea, and I'm wondering if there's a way to prevent the key from also being typed into the textarea if it's a certain key. I have tried stripping off the last character from the value property, but it seems that the character is added after the event handler finishes.Here's my code, in case it helps: