It only seems to work if no values are filled in, if one of the fields is filled in the error checking fails. Again, I'm extremely new to JS, i've only ever copy/pasted and this is the first time i've tried writing a piece.
I have a form that displays various hidden divs if a visitor checks a certain option in my form. For example, if they select Yes in a radio button a few more form fields will appear beneath it. It works fine except when the form is not filled out properly and the form is displayed again (using PHP). When the page reloads it doesn't show the hidden div unless they select No.
how to make it so if they select Yes, it will make the div appear again when the page reloads? Here's the code I'm using: Code:
I'm trying to understand how JS constructors work. In particular, I'm trying to work out how I can call a parameterised constructor and check that the values of the parameters are valid within an object that has private properties. So for test purposes, I construct a data of birth object like this:
HTML Code: <pre> function Dob( day, month, year ) {
I'm currently learning many web programming languages and figured this would be a good way to learn more and do things better. I have been working on a contact form for my website. I had originally did the error checking in PHP, but I would like to change it to JaveScript since this is the preferred way. I have it all semi working,It seems like I have some unnecessary variables and such.. I would like to clean it all up as best as possible.
I made a contact form for my website originally in PHP. I wanted to change it to JavaScript because that is the preferred way. Originally I had the form in my HTML file using a separate PHP file for error checking. For JavaScript do I have to make a separate page and call to it like the last time? I have put it all on my HTML page and where it was calling for the php page, I also put the JavaScript code. When I go to my site, the error checking is not working at all. There must be something wrong, but I haven't been able to point it out and I am very new to JavaScript. Also, when I go to my page and right click for the source code, the JavaScript I have in there does not show up. Below is my HTML code.
I'm trying to create a "Books I'm Reading" widget using the Readernaut API. I'm using JSON with a callback. This is a portion of what the JSON URL returns:
I am new to Javascript. I copied this script from the web, but I get an error at this line:parent.removeChild(child);The error says "Invalid argument".
I know I have a simple syntax error. Trying to call a function which changes the style of a div element on mouseover. Heres my code. Javascript function countermarker1(){ var box1 = document.getElementById('countermarker1box').style.display box1 = "block" } Variable is used cause I will have to use it more often later in the script.
HTML <div id="countermarker1"> <img src="countermarker.jpg" width="20" height="14" onmouseover = "countermarker1()"; /></div> CSS (know its not really relevant just to avoid questions about whether its right) #countermarker1box { height: auto; width: 80px; display: none; } JS and css is externally srced.
I am really confused as similar code on Tizag web site works fine. Code: <script type="text/javascript"> function changeText(){ document.getElementById('boldStuff').innerHTML = 'Fred Flinstone'; }</script> <p>Welcome to the site <b id='boldStuff'>dude</b> </p> <input type='button' onclick='changeText()' value='Change Text'/>
I have a VERY simple script to reload a page with fresh values when the value of a scroll menu changes. Trouble is, of course, NN 4.- freaks and closes the browser when this runs. No error warning, no error log?
I was trying to create JavaScript error handling for a form, and I was trying to get an error message to show up underneath the field where there was an error. (I am trying to avoid alert boxes.) I only have two fields, and my problem is that only one field is showing an error message. If I place an error in the input for the second field, the error shows up under the first field. How can I get the error messages to show up under the correct form field?
IM NEW AT THIS AND I'M WORKING ON MY FIRST WEBSITE. I USED iWED AND I DON'T UNDERSTAND WHY IT WON'T WORK. WHENEVER I TRY TO OPEN IT IT SAYS: Parse error: syntax error, unexpected T_STRING in /home/a2460084/public_html/beto/index.html on line 1
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">[code].....
I'm new to jQuery and the validation plugin, I just wondered if it is possible to get the error messages to be shown in an error summary section instead of inline?
I am developing a web page . For this i am using Javascript embedded in html. In the application ,the user can input data via interfaces in the page which is chosen and read from a master xml file , the chosen data then needs to be stored and saved in a xml file.I have designed the web page in FrontPage.
Now the problem i face is while trying to save the output xml file i get error Permission Denied , error code 0 . This happens when i try to open the page in browser IE 6.0 SP2.I am using DOM parser methods for doing the xml manipulations/savings etc.urprisingly this works in another machine.Also can i use the all of the same javascript code if i want to run it in an IIS. Do i have to do some changes to make it server side javascript code.
I am working on a simple javascript craps game program. I need some advice since it won't display who the winner is, keep tally of who wins/loses, and the number of total games played. After using the error console there's an error with document.forms [0].thrower.value not being defined.
I have some javascript that uses setInterval(..) to change the src of an image every second. Is there any way of programmatically checking to see whether an image is loaded properly or if a 404 File Not Found error occurs for it?
for a button called "pbRegistration" that checks to see if the value of textbox (tfOtherJobTitle) equals "test" and on completion of the typing "test", it enables the button. Why isn't it working?
...what I'm trying to do is pass through the value of the checkbox ticked through to a function. This function will then, depending on whether the box is ticked or not, untick the access# checkbox.
I can pass the number through to my function, but I'm having difficulty trying to reference the actual checkbox from the script. This is what I've got so far...
function AM_MenuSelection(opt) { var myOpt=document.frmNew.view[opt].value; alert(myOpt); }
As you can see, I can reference the value of the object, but need to be able to access the related access# object.
I'm trying to run some code when a H2 element is clicked on an unordered list below it. The problem is, the code runs whether the h2 has a ul below it or not.
h[x].onclick = function(){ var ul = this.nextSibling;
Clicking "Subtitle" runs the function on "Subtitle 2". I don't want the function to run unless the next element is an ul. How can I verify that the next element is an unordered list and if not, don't run anything?