I've got the following form validation script. How can I include the quote marks as a bad character?
I tried: var bad_email_chars="/!#$%&*+^ ()_-=|~`?;:,'""" It didn't help.
if(form1.elements(i).name=="text_website") { var bad_email_chars="/!#$%&*+^ ()_-=|~`?;:,'" var h,j for(h=0;h<bad_email_chars.length;h++) { for(j=0;j<input_str.length;j++) { if(bad_email_chars.charAt(h)==input_str.charAt(j)) { alert("you have atleast one bad character in you website address. You may not submit this form until you correct this.") window.event.returnValue=false form1.elements(i).focus(); }}}}
Also, How do I format with indentations and as non wraping text the messages I send to this forum?
I'm trying to check a database of lotto numbers against 3 different values and have gotten it that to work. What I need is to give a feedback message if no match is found once the submit button is clicked.
function winCheck() { var grandPrize = $('#grandPrize').val(); var otherPrize = $('#otherPrize').val(); var addPrize = $('#addPrize').val();
Then when I run I get this error unterminated string literal selectAndUpdate('EA13','GY','210/60R. That means my third value from the db got problem due to the slash right? How to overcome this?
in IE only (tested version 7) if var myWord = "English" then it works fine but if var myWord = "Modifier Chau00EEnes" then I get "Unterminated string constant" error.
What fix would you suggest to keep div.innerHTML = "" format?
The XML my PHP app is returning to my JavaScript function has elements in it that contain special characters... specifically the ampersand & which hoses up the data. ex: Company Name = "K & B Construction".
Can anyone give me some idea of how I make the data coming out of my database translate as literal characters in the XML output?
I need a simple, quick and efficient way to logically branch if I find a string is contained in another string in jquery Most other languages this can be resolved in one or two lines and it would be readable.
im trying to read an xml file and put it into a textarea on my page. here is the code that returns the xml file as a string:
Document doc = new Document(); SAXBuilder saxBuilder = new SAXBuilder("org.apache.xerces.parsers.SAXParser"); XMLOutputter xmlOut = new XMLOutputter(Format.getPrettyFormat()); doc = saxBuilder.build(filesName); String xml = outputter.outputString(doc);
no when i try to pass this to a javascript as follows: function putXML(fileName){ var blah = '<%= xml %>' document.btraxtestForm.HighwayMessage.innerText=blah; }
it gives me a unterminated string literal error.
also, i will never know the contents of this xml file so i cant split up the string. has anyone any ideas how i will fix this?
I created a simple WYSIWYG for creating CSS based webpages. It works exactly as assumed in Safari and Chrome. However, in firefox, when you copy/paste more than one line of text, instead of formatting it as html, in puts in line breaks causing the array storing all of the data to break into multiple lines and causing an unterminated string literal.
1. suggest why it is behaving this way? 2. suggest a work around to allow it to work on FF?
I have taken part of some code I know works and simply added a print statemet to it as I want it to print to the command prompt, where I am running the script, the value of REMOTEDIR why the addition of the print statement provides an error: ERROR: JScript runtime error: Object expected
<p> Howdy <p> expressed as a literal string that is passed to the setTimeout() function might look like this: setTimeout("document.getElementById('first').innerHTML = '<p>' + 'HOWDY' + '</p>';", 2000);
I guess you can't just put quotes around an expression like this: "'<p> HOWDY </p>;" So tags have to be isolated, but it get confusing with expressions like this, which I am not sure how to express as a string:
I wish I could change the " in there to ' and then just wrap the whole thing in double " This is what I came up with but it did not work: setTimeout("document.getElementById('first').innerHTML = '<p>' + '<h2' + 'class='pos_left'' + '>' + '<img' + 'src='car1.jpg'' + 'name='slide'' + 'width='400'' + 'height='250'' + '/>' + '</h2>' + '</p>';", 4000);
I need a regexp function which makes a match when the string contains <img...AND the img tag above dows NOT contain a certain path Here is what I have:
<imgs.*(src).+>
This matches if my string contains "<img .....src.....>" (the dots can be anything, I dont care). However, after the "src" part and before the ....
I am trying to create 3 elements on the fly when a button is clicked. The button is the show an upload form for images. I am using uploadify (first time using it) and I have several different upload type/options for them so I am sending id's to differentiate between them. The problem I am having is when trying to create the script tag which in turn controls the input file type tag, and it is baffling me. Here's the code first:
I'm receiving an "Object Expected" Error (Line:28, Char:7). I'm confused as to what is happening. I have virtually the same exact function in a different web page and I do not receive an error with this other page. Also, if I run this code in Fire Fox, I do not receive any error. Is there something that I'm missing? The error is pointing to "TextChanged();". Code:
Here's my problem - I have AJAX working for a login script in firefox, no flaws I can see, but in IE all I get when clicking the login button is nothing but an error saying ....