Jump to content

nogray

Members
  • Posts

    930
  • Joined

  • Last visited

Everything posted by nogray

  1. Without seeing all the code it's hard to tell where the error is. Are you adding the mouse move event to the document or the parent element? your onmouseup remove the event from the document. Second issue you would have to deal with is when the mouse move out of the area (but the user didn't leave the button). The onmouseup event won't be triggered because of that, so you would need to check onmouseout. The easiest way to do this is to sent the mousedown and mouseup on the document and use the target in your event to find out if the moveable element was cliicked.
  2. you would actually check the character and compare it to a list of pre-determined characters for different languages. E.g. If I start typing "Something..." you would check the S and find it's not a RTL language If I start typing "هذا" you would check the characters to your list and determin it's a RTL. Since most languages are LTR, you only need to check if the character is a RTL language character or not.
  3. JavaScript can't tell when the user change the language, what you can do is check the last character the user type and compare it to the language letters and change the directions accordingly. There will be some characters that you should ignore (like ., and numbers)
  4. If the field was not disabled and you called the function, the first if statment will disable it and the second if statment will check if it's disabled (and it's because the first if statment) and enable it. instead you can if else statment instead of two if statments.
  5. if (document.forms['form']['targetname'].disabled = false) needs == for comparson, same with the other if statment and your if statments will cancel each other if the field is disabled. Maybe you need to use else if.
  6. Javascript doesn't have a method called empty. You would have to compare the value to empty string (e.g. val == ''). To add content to an array, you would use the push method (e.g. my_arr.push('my value'); )
  7. You can just add the variable in your html page before you include the scripts, using dannyb785 example, you can just replace the javascript part by <script type="text/javascript"> var my_step_min = <?php echo $stepMinute; ?>; </script> ... later on your js file ... // check if my_step_min is defined, if not, create a default value ..... ..... timeformat:'h:m', stepMinute:my_step_min} .....);})
  8. You can't access the css properties using obj.style.prop unless it's an inline style. You would need to use currentStyle
  9. Change alert(content[i].childNodes.innerHTML); to alert(content[i].innerHTML);
  10. Changing the selected value in the option after the menu is created won't do anything. You need to change the select menu selectedIndex to the option index (e.g. loop through the options and compare values, when you have a match set the selectedIndex to i)
  11. getElementsByTagName needs a tag as a string, you can use document.childNodes() to get all the child elements. You will have to check for nodeType since this will also return text nodes.
  12. I think you're looking for jsfiddle http://jsfiddle.net/
  13. In your snow.js, remove the comma behind the last item in the object c.fill(); }// remove this comma , };
  14. The array indices starts at 0, so if any array has 5 items, the last index will be 4. e.g. var arr = ['a', 'b', 'c', 'd', 'e']; alert(arr.length); // alerts 5 since we have 5 items in the array alert(arr[0]); // alerts a, first item alert(arr[4]); // alerts e, last item alert(arr[5]); // error, that would be the sixth item
  15. In both your for loops, you need to use less than (not less or equal) e.g. for(var i = 0; i < forms.length; i++){.... .... for(var ii = 0; ii < divInputs.length; ii++){...
  16. Make sure to set the http headers to javascript header("Content-type: text/javascript"); Also, you file contains a lot of HTML code which will cause a javascript error and stop it from executing.
  17. You need to add "return" in your onsubmit event e.g. <form ..... onsubmit="return validate();">
  18. If you want to do it with javascript, you can use the split function e.g. var my_str = "This is not I would like to do ~ what do you mean"; var arr = my_str.split('~'); alert(arr[0]+' || '+arr[1]);
  19. Google is your friend http://www.lmgtfy.com/?q=javascript+sort+table
  20. You can try to add an onunload event in the pop up page. The main page and the pop-up page must be in the same domain. e.g. window.onunload = function(){ window.opener.location.reload(); }
  21. I've seen jquery sortable used, you just need to make sure to use the thead and tbody tags and apply the sortable to the tbody. http://jqueryui.com/demos/sortable/
  22. Using jQuery for this simple function is way overkill. Also, disabled fields are not sent with the form when submitted. If you want to stop the user from changing the info, use readonly
  23. change the "onclick" to "onchange"
×
×
  • 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.