Jump to content

nogray

Members
  • Posts

    930
  • Joined

  • Last visited

Everything posted by nogray

  1. You are assigning the results of writeQuote() to your onload event rather than assigning the function itself. Change window.onload = writeQuote(); to window.onload = writeQuote;
  2. You are using single quote to enclose the onclick event and single quote on the alert message, so the browser sees your onclick code as onclick='if(!this.form.rFlight.checked){alert(' Try the following echo "<input type='submit' id='button1' name='booking' value='Make Booking for the Selected Flight' onclick=\"if(!this.form.rFlight.checked){alert('You must select a flight.');return false}\"/></br>"; Another note, you should put your form validation on the form "onsubmit" event. This way your code will work on all browsers
  3. You have the following on the beginning of your validation function. It should be hallo_art (not hallo_web). document.getElementById('hallo_web_name1').style.display = "none"; document.getElementById('hallo_web_desc1').style.display = "none"; document.getElementById('hallo_web_tags1').style.display = "none"; Also, beside JavaScript validation, you need to validate the input in the server using PHP and make sure it's correct. Finally, before inserting any data into your sql table, you need to escape it to avoid sql injection. http://php.net/manual/en/function.mysql-real-escape-string.php for more
  4. Some browsers now treat an onclick return value as the submit return value in submit buttons. For example, if your onclick returned false (or cancelled the event), the form won't be submitted. You might want to change your logic and make the click event set some variables for the submit method to check and do what you need.
  5. I think it's called "Edit in Place"
  6. I would agree with Psycho on adding empty spans for the error messages and populate them when needed. If you don't want them in your html, you can create the spans on the fly using javascript. You don't need to track the user clicks because that will simply submit the form when someone click twice. What you need is to clear all the error messages at the beginning of your validation function and check the fields. If you just create text nodes, it will be hard to track down the error messages.
  7. If you use IE, you can always hit the F12 button to see the developer tools which will point you to the error in your code. JavaScript variables are case sensitive, so BioEmot and BioPhy in your document.write are not defined (should be bioEmot, bioPhy). You might also need some basic HTML touch up in your list, each list item should be enclosed in a <li></li>
  8. You can use a simple conditional comment for IE. e.g. put this in the your page header. <!--[if lt IE 7]> <meta http-equiv="refresh" content="0;URL='http://www.mydomain.com/mypage/'" /> <![endif]-->
  9. Why not just use a regular expression to remove undesired values. This way you don't have to worry about the keycode, language, encoding, etc... e.g. alert('12 trees'.replace(/[^\d]/g, ''));
  10. Here is a quick list of errors found. The last item in an object should not have a comma after it. height: "variable", // remove this comma } //... height: 250, // remove this comma }, //... pauseOnHover: true, // remove this comma }, //... pauseOnEvent: 'resume', // remove this comma }
  11. try this $('.likehide'+pid).html('<a href="#" onclick="unlike('+pid+'); return false;">unlike</a>');
  12. Yes, your objects are not reference and that's why I mentioned the error is most likely in the html build up. Your onclick event might referencing the wrong object. Try to make a different alias for each window or try to make a different outlook window called outlook2 and see if that makes any difference.
  13. Objects, Arrays, Dates are passed by reference in JavaScript, so even if you assign it to a new variable, it will still point to the original object. Usually, you would loop through the object properties to clone it. I think your problem is with the HTML build up rather than the objects. From a quick look, I don't see a unique id for each window and when you reference to html element by class name, the first element is updated. Each window should have a unique id and all changes or updates should use that reference into account.
  14. Just use a noscript tag e.g. <noscript><strong>YOU NEED JAVASCRIPT</strong></noscript>
  15. You are assigning the output of the function goodbye to your onunload event. You need to assign the function itself instead, e.g. window.onunload = goodbye;
  16. Since you are using jQuery, you can simply add a class to your input field and use the class selector in your script. e.g. $('.my_css_class').timepicker({
  17. You can just add the ul tags in the first line of code val = '<ul>'+val.replace(/^ \* (.+?)(\n|$)/gm, "<li>$1</li>")+'</ul>';
  18. You can just use the input field value. You will probably get "fakepath/" as the directory for security reasons. e.g. alert(document.getElementById('my_file_input_id').value)
  19. You should put your code in the ready function, onload function or in the bottom of document. You are trying to access the HTML elements before they are created.
  20. Add "return false" in your click event to cancel it. <li><a href="#" id="1" onclick="focusMe('1'); return false;">menu1</a></li>
  21. Most likely the error happens because your input field is named "password" and you are using a variable called "password" in your function. IE tends to use elements name as objects in Javascript. Try to rename the variable in your functions to something else like "pass". A tip about security, hashing the input using Javascript doesn't really make any difference since all the Javascript code is executed on the browser and can be reversed very easily. If you are really concerned about users security, just use an SSL certificate.
  22. From what I can see, you are trying to delete $_POST[id] but none of your checkboxes is named "id". If you view the source code (in your browser), you'll probably see the name as a number. Also, some servers don't pass arrays from your HTML form and you'll only get a string value "Array", you might want to check that as well.
  23. Your $lefty may not have the "left" css property set initially, try to alert your value and see what you get.
  24. The example just change the image, you can create two images one play and one pause and add a click event to change them <img src="play.png" onclick="if (this.src.indexOf('play.png') != -1) this.src = 'pause.png'; else this.src = 'play.png';" />
  25. Because you only declare the index candy[ 0 ] as array, candy[ 1 ] is not defined. You can simply declare the arrays in your loop var candy = []; for (var i=0; i<10; i++){ candy[i] = []; candy[i][i] = 'Sweet!'; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.