279 Posted Topics
Re: Perhaps you could give us some code to work with? The description "the code was in js and html" is not really a full sourcecode ~G | |
Re: The event argument is automatically passed on with the function, alternatively you can use: [CODE]canvas.onmousedown = function(e) { return myDown(e); }[/CODE] I am not yet familiar with the HTML 5 javascript methods, but it appears as if the init() function formats the canvas into a moveable object, and then redraws … | |
Re: You can modify the styles of elements easily: Let's say you have some have an element with some text: [CODE]<span id='my_text' style='font-family:Arial;'>Some text</span>[/CODE] Then you can use JavaScript to change its font family: [CODE]document.getElementById("my_text").style.fontFamily = "Times New Roman";[/CODE] For all CSS properties and how to use them in JavaScript, see: … | |
Re: Look on: [url]http://en.wikipedia.org/wiki/Geometric_Shapes[/url] ~G | |
Re: You can handle the keys pressed on the keyboard: [CODE]document.onkeypress = function(e) { return HandleKey(e); } function HandleKey(event2) { var key; /* Retrieving the pressed key: */ if (window.event) { key = window.event.keyCode; //IE } else { key = event2.which; //firefox } /* Switching the pressed key: */ if (key … | |
Re: Line 1 - No document type? Line 2 - You forgot to add [ICODE]<title>MyTitle</title>[/ICODE] element Line 4 to 16 - Your script needs to be either within the <head> or within the <body> tag Line 20 - You did not add the id attribute: [CODE]<select name="box" id="box">[/CODE] Line 21 - … | |
Re: Do you mean that the form is loaded without the page being refreshed/changed or with the page refresh? Anyway, if the page is refreshed after the user pressed the button, you can just simply retrieve the form values using PHP and then echo that as values inside the full form: … | |
Re: Executing a file on your system, via javascript is only possible when people use Internet Explorer (as it is like a swiss cheese when it comes to security): [url]http://www.tek-tips.com/viewthread.cfm?qid=1226233&page=1[/url] ~G | |
Re: You can in fact make a timer (= interval) that increments the variable 'play_time' every second, untill it reaches the end of the length of the song. Then it resets the play_time and load a new song. I am not sure how you play the song, so you need to … | |
Re: The message will only pop up if you are submitting a form from the secure [url]https://*[/url] page to the [url]http://*[/url] page. If you do not submit a form, and just redirect the user using a header() or a regular <a> element, the warning you described will not be shown. ~G | |
Re: >> Line 1 - There is no attribute for the form tag called 'value' >> Line 4, 5 - Do not use spaces between attributes and their values (so [ICODE]value = "sid"[/ICODE] needs to be [ICODE]value="sid"[/ICODE]) >> Line 12 - Add a attribute "name" with the value "submitted" to the … | |
Re: I think it is waiting for the the AJAX response for retrieving your email, and as this is alot of information and there are ALOT of people doing that on the same moment, it takes some time before it all is retrieved :) Progress bars are only for the entertainment … | |
Re: [B]>> How can I learn JavaScript?[/B] Follow the tutorial on the the website below: [url]http://www.w3schools.com/js/default.asp[/url] And when you have finished it you know the basics of the language. [B]>> Is there any other way of building the menubars without the use of javascript?[/B] Yes there is, by using CSS: [url]http://www.google.com/search?q=css+menubar[/url] … | |
Re: Check whether the productid is already inserted in the jsp page and if it is don't add another record and if it isn't insert it? | |
Re: As soon as you wrote some code or post code you already have to do the thing you described and stumbled upon a problem, let me know by posting it below and I will be happy to point you in the right direction to get your code working ~G | |
Re: You probably ment the following function: [CODE]function chn(){ /* Retrieving text to be hashed: */ var text = document.getElementById('txt1').value; /* Hashing text: */ var hash = $.md5(text); /* Showing hash: */ document.getElementById('txt2').value = hash; }[/CODE] ~G | |
Re: Hi and welcome to DaniWeb! When posting code, always make sure you put it between CODE tags: [CODE]Some code...[/CODE] Now onto your problem: You are starting off with jQuery before you even understand how JavaScript works. jQuery is an extension of JavaScript, making writing it easier. As you have a … | |
Re: Using live search is a bit difficult to get working when it is your first AJAX related project, but anyway, here are some tips: - First test whether the PHP page shows the correct HTML, by just visiting the PHP page in your browser and adding the GET variable manually: … | |
Re: You can redirect visitors after you processed the form (around line 175) using the Header() function: [CODE]header('Location: http://www.example.com/');[/CODE] See the reference: [url]http://php.net/manual/en/function.header.php[/url] ~G | |
Re: Rounded corners is difficult if you want the browser to make it, but you can just simply use a image as background, that has rounded corners: [CODE].Button2 { background-image:url('images/button_out.png'); background-color:none; border:0px solid red; padding:0px; width:100px; height:20px; } .Button2:hover { background-image:url('images/button_on.png'); background-color:none; border:0px solid red; padding:0px; width:100px; height:20px; }[/CODE] Also when … | |
![]() | Re: The solution is pretty simple, I think? It does not matter what choice you make: Option A) If you shoot him, you will die anyway (because of old age) and your family will also die eventually (because of old age) Option B) If you decide to not shoot him, you … ![]() |
Re: You have alot of typo's in your HTML: [CODE] <a href="chapman/IMG_1626 copy.jpg" rel="lightbox" </a><img border="0" src="http://www.phughesphotography.com/chapman/IMG_1626 sm.jpg" align="center" width="200" height="133"></a>[/CODE] Needs to be: [CODE] <a href="chapman/IMG_1626 copy.jpg" rel="lightbox"><img border="0" src="http://www.phughesphotography.com/chapman/IMG_1626 sm.jpg" align="center" width="200" height="133"></a>[/CODE] I did not take a look at your lightbox code, but I assume it works.... ~G | |
Re: Ivan, I see you used the tutorials I gave you to make a rich text editor, but you did not copy them correctly. For instance, line 9 and 10, you neglected to close the <body> and <html> tag, which is probably causing your problems. If you want to change the … | |
Re: It's not the fault of the HTML nor CSS, if you would read the sourcecode, you would see that after every dot (.) there is a unknown character icon. This is caused by your editor that you use to type the text (your CMS perhaps), which adds a unknown character … | |
Re: Yes it is ;) You basically set session variable in which you declare various levels of authorization: [CODE] $_SESSION['LOGINDATA']['AUTH'] = 2; // 0 = guest, 1 = member, 2 = admin[/CODE] And then you check on any page what to show: [CODE]switch ($_SESSION['LOGINDATA']['AUTH']) { case 0 : echo 'You are … | |
Re: Line 22, 33, 35, 37, 44 - You forgot to close the quotes ~G | |
Re: A) This is not the existing scripts forum B) Send an email to the person that wrote this script and ask him to answer your question C) The code is extremely unreadable, unclear and confusing. As I did not wrote the code, I have no idea what it does. It … | |
Re: If you want to use two different DB connections, you need to start using the mysqli functions instead of the mysql functions. In the mysqli functions you need to specify which database connection you use to execute the queries and functions. Also, when selecting a database always use a or … | |
Re: When you want to darken a page, you place the following HTML right after the <body> tag: [CODE]<div id='darkscreen' style='position:fixed; top:0px; left:0px; color:black; opacity:0.5; filter:alpha(opacity=50); width:100%; height:100%;'></div>[/CODE] If you want to toggle its display, you can use: [CODE]document.getElementById('darkscreen').style.display = 'inline'; // Show document.getElementById('darkscreen').style.display = 'none'; // Don't Show[/CODE] ~G | |
Re: Making the converter can be done in JavaScript, like you showed on the link you added. I'il give you a head start on how to: You have two text inputs, I already made the first for you: [CODE] The currency you have: <select id='have_cur_type' onchange='NewHaveCurType(this.value)'><option value='euro'>Euro</option><option value='dollar'>Dollar</option></select><br /> The amount … | |
Re: There is nothing tiny about it ;) References and tutorials on developing rich text editors are rare and extremely difficult to find (I never found one till today). You should check out the open-source rich text editors and try to understand what they do in the sourcecode. An example of … | |
Re: Howmanny times do I need to post this on DaniWeb: AJAX is a set of functions of the language JavaScript jQuery is a set of functions written in JavaScript, it might be considerate as a library for JavaScript but is not build-in and needs to be included using the script … | |
Re: Line 9 -> You put quotes around the column name, also it is a bit vague what you mean with $_REQUEST['select'] , why are you using the same value as column name? The select query is formatted as following: [CODE] SELECT * FROM table WHERE column='value'[/CODE] Echo your query and … | |
Re: You can not show text before PHP is executed, however you can show a message after the PHP is executed and the HTML is being loaded by the browser: [url]http://www.weberdev.com/get_example-4431.html[/url] ~G | |
Re: There are a few points you need to adjust in your HTML >> You should stop using spaces between attributes and their values >> The input tag needs to be self-closed Correct usage example: [ICODE]<input type="radio" name="course" value="CBA" />[/ICODE] And then there are a few points you need to improve … | |
Re: Right... Not any of the people that help here have experience with PHP NUKE (that I know of), and even if they did, they would never go through 500 lines of code, of which they do not know what code does what. Perhaps you should narrow your problem down to … | |
Re: Right... Line 12 + 17 - variable 'submit' undeclared. You should use the following: [CODE]function showHide() { if(document.getElementById('Checkbox1').checked == true) // If the checkbox is already checked { document.getElementById('submit').disabled = true; } else // If the checkbox is not yet checked { document.getElementById('submit').disabled = false; } }[/CODE] And in your … | |
Re: 1. You neglected to end each line with a ; 2. It is window.location.href = 'URL'; 3. Your indenting is a bit weird, see the following URL on how to code properly: [url]http://www.webdevproject.com/guides/programming/guide2.html[/url] ~G | |
Re: You mean blur = make more light? See the following link: [url]http://www.w3schools.com/Css/css_image_transparency.asp[/url] ~G | |
Re: It is positioned fixed: [CODE]<div style='position:fixed; bottom:0px; left:0px; height:20px; width:100%; background-color:blue; z-index:100000000000;'> This is a bar on the bottom </div>[/CODE] However, this only works in FF. As you can see at DaniWeb, the toolbar only pops up in FF and not in IE. ~G | |
Re: As this is urgent, iil give you the solution, but study the code and learn from your mistakes. Each code lines needs to end with a ;, use more spaces and pay attention on how I use the setTimeout() function: [CODE]setTimeout(function(){ //Here should be all the code you want executed … | |
Re: Line 13 - Undeclared variable xmlhttp. Before you create the object, user [CODE]var xmlhttp = false;[/CODE] Then before you do the request, use: [CODE] if (xmlhttp) { //... Your code.... } else { alert('Could not create AJAX object.'); }[/CODE] If this does not solve it, you should add alert()'s between … | |
Re: >> Line 21 - The variable "i" is only available in the for loop, and so on line 27 "i" is not declared. >> Line 26 - GlobalPic not declared. Move var globalPic to line 1 from line 42. >> Use alert() between the code to debug your code. ~G ![]() | |
Re: You forgot to add the unit to the value and your CSS is not entirely correct, use the following: [CODE]#cart { overflow:auto; border:1px solid red; height:500px; margin-left:10px; margin-right:10px; margin-top:20px; margin-bottom:0px; font-size: 12px; text-align: left; font-family: Verdana, Geneva, sans-serif; background-image:url('images/side.gif'); background-repeat:no-repeat; }[/CODE] ~G | |
Re: That is indeed easy to do: [CODE]<select onchange='clearFields()'> .... Some other html etc.... <input type='text' id='InputId' maxlength='255' />[/CODE] And then the javascript: [CODE]function clearFields() { document.getElementById('InputId').value = ""; }[/CODE] ~G | |
Re: Right... Well you need to isolate the search code out of the php and put in in search_engine.php . search_engine.php retrieves the variables out of the URL using GET and searches your database. Then it echoes all the rows found. Then you create a JavaScript function that retrieves the value … | |
Re: The correct syntax to hide something is the following: [CODE]document.getElementById('theId').style.display='none'; document.getElementById('theId').style.display='inline';[/CODE] ~G | |
Re: That is some real strange quote work you got there. Perhaps if you would clean up your quotes it might help... Example of a correct usage of quotes (the code has nothing to do with yours, just watch how the quotes are placed): [CODE]<div class="someClass"> <hr class="main_sep" /> <img src="images/img001.png" … | |
Re: That really is not that difficult. You can change the display of a element using: document.getElementById('divId').style.display='none'; document.getElementById('divId2').style.display='inline'; And the 2nd line javascript should be triggered onmouseover, and the 1st line onmouseout. Make them into 2 little functions and voila you got yourself a popup. ~G | |
Re: If you want the page to not reload, JavaScript is the way to go. However as you do not have experience in programming with JavaScript and the subset of JavaScript functions AJAX, I recommend you use only PHP. When you only use PHP you need to do the following: [CODE]if … |
The End.