Jump to content

Search the Community

Showing results for tags 'javascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. First off, I'm working on a WordPress website. I'm having issue getting the video to play in the FV WordPress Flowplayer: (1) auto play when the page loads (2) Listen for the button click event (purposedly added the comment tag for testing either one) Here's my code: var $j = jQuery.noConflict(); $j(function(){ (1) $j('#post-1823.flowplayer').flowplayer().play(); (2) /*$j('#post-1823.flowplayer').flowplayer({ play: function(){ console.log('IT PLAYS!'); } });*/ }); The error I'm getting for (1) is "Uncaught TypeError: Object[object Object] has no method 'play'" Uncaught TypeError: Object [object Object] has no method 'play' - custom_scripts.js:33 (anonymous function) - custom_scripts.js:33 x.Callbacks.c - jquery.js?ver=1.10.2:3 x.Callbacks.p.fireWith - jquery.js?ver=1.10.2:3 x.extend.ready - jquery.js?ver=1.10.2:3 q I'm thinking that it's not understanding any of the flowplayer api functions. *Ref Link*: http://flowplayer.org/docs/api.html Can someone please assist me with these issues? Thank you, rolu
  2. Hallo. I have a form <form id="form2" method="post" action="insert_data.php>"> <select name="catid" id="catid" onChange="showkatigoria(this.value);"> <option value="'. $row['catid'].'"><h4>' . $row['catname'].'</option> // something i need with php, i dont' think it matters <option value="'. $row['catid'].'"><h4>' . $row['catname'].'</option> <option value="'. $row['catid'].'"><h4>' . $row['catname'].'</option> //option value bla bla bla bla i have 4-5 options value. </select> My javascript: <script type="type/javascript"> function showkatigoria(str) { if (str=="") { document.getElementById("catid").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("catid").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","insert_data.php?category="+str,true); xmlhttp.send(); } </script> It doesn't work what ever i do. Please help! I don't know javascript, let alone ajax. It's urgent. Please help!
  3. I have the following codes: if(window.location.pathname.search(/\?/) != -1) { var refUrl = window.location.pathname.strip(/\?/); } else { var refUrl = window.location.pathname; } var pathname = refUrl += '/' + 'hey' + '/' + 'what'; alert(refUrl); I'm running a check to see if there are any characters in the pathname, if so, strip it out. The output is : /_display//hey/what So basically it didn't strip anything characters out from the pathname after testing this on jsfiddle. Can someone please tell me what's wrong with it? Thank you, halben
  4. Dear , I am need of some thing with the help of which i would be able to generate dynamic/variable documents for my business use. I need a data input page where one can feed all data at one place & later on same data came be parsed to various pre formated documents. As per my need, i have to write several documents related to single business deal. I have to fill up same details in all those documents. So, my idea is fill up all such information at one place then later on, the same data can be passed on to all related documents for printing purpose. You can create one data entry module (like forms etc.) to collect relevant data then create another module in which i can link different documents format in which data can be lifted from the collected information. I requires to create something which can hold input variables then you have to retrieve all those variable in documents. I am attaching 3 files in order to understand you better my project. These 3 files are having data sample, sample document & finished document. link of document ; http://goo.gl/fVKBmv project.zip
  5. Hi, I have an ecommerce site and i want to have a bookmarklet. I heard it should be done in javascript. Does anyone here who can help me? I'm a newbie but i'm a fast learner. thank you.
  6. I have creating a contact form with validation. but i have no idea to validate the contact form which platform. anybody having new idea to validate the contact form pls reply. otherwise tell any good PHP Training Institutes? My friends are recommending this PHP Training Institute
  7. Hi I have a registration page for a website, in that i want to generate random number to disable the person's profile. Here the random number should generate after he creates his profile and that should be sent to the person through mail. He should enter that number for disabling his profile. I want the sample code or script by which i can implement easily. Thanks in advance Revs
  8. Hey, I would like to import data from CSV files to my application, First i've upload csv on to server then get csv contents by fgetcsv(), after that i want to map uploaded data and validate then send to db otherwise show error. Please suggest me how to do. Thanks
  9. Greetings all, I have a bit of challenge that I don't know exactly how to solve. What I am trying to do is open a popup window using javascript and also redirect the page that has the original link on it to a new page. Basically what I want to happen is, user clicks on link, page redirects and a popup window opens at the same time. Sort of like having two links in one. Here's what I tried. It didn't work. echo ' <a href="sectvideo.php?sect=' . $row[0] . '"> ' . "<a href=\"javascript:create_window('".$row[1]."',640,360)\">" . ' <div id="historyUniqueWrap"> <div id="historyUniqueImage"> <img src="'. $row[2] .'"/> </div> <div id="historyUniqueTitleMessageWrap"> <div id="historyUniqueTitle"> <h4>Section: ' . $row[0] . " >>" . '</h4> <p>' . stripslashes($post1). "..." . '</p> </div> </div></a></a> Any ideas? Best Regards, Nightasy Edit: I just had an idea, I could set a condition to be met in the page that is being linked to using a GET. That would solve this issue. I'll try that and report back if it works or not.
  10. Hi, I am not asking for code, If you provide it thank you but I am happy to do the work myself I am more after the concept and code snippets. My Goal, I have 2 domains for this I will use www.1.com and www.2.com to make it easy. 1.com has a couple lines of javascript and 2 variables 1 being a domain and the other being a unique ID 2.com has a php script which is called by 1.com when the page is loaded (somehow) it will check the Unique ID and the domain that they match in a mySQL database and if they do to run another javascript script. If it does not to just end itself. The problem I have is I know PHP to an average level but Javascript well below average. I need to know how to run the PHP script from an external site 1.com to run a generic PHP script from 2.com and use the variables from 1.com to check the database at 2.com for a match and to either say yes matching display: or not matching deny. If anyone has any ideas on how to do this or something they have done before that would be awesome. I am wanting to to put the javascript on 10 different websites with different variables and for 2.com to just do the checking. for security reasons I need the URL to be checked so if 1.com loads and says the URL is 1.com but infact the user loaded 55.com it needs to be denied so PHP on 2.com needs to know where the request came from which domain... PLEASE HELP
  11. I am new to PHP, i started developing application using php, please look into my code index.php <?php require_once('./config.php'); ?> <?php /* * Following code will get single product details * A product is identified by product id (pid) */ // array for JSON response $response = array(); // check for required fields if (isset($_POST['name'])) { $title = $_POST['name']; $company = $_POST['company']; require_once('./db_connect.php'); // connecting to db $db = new DB_CONNECT(); // mysql inserting a new row $result = mysql_query("INSERT INTO user(name,company) VALUES('$title','$company')"); } ?> <html> <head> <link type="text/css" rel="Stylesheet" href="style.css" /> <script type="text/javascript" src="jquery-1.7.2.js"></script> <script type="text/javascript"> $(window).load(function () { var tabContents = $(".tab_content").hide(), tabs = $("ul.tabs li"); tabs.first().addClass("active").show(); tabContents.first().show(); tabs.click(function() { var $this = $(this), activeTab = $this.find('a').attr('href'); if(!$this.hasClass('active')){ $this.addClass('active').siblings().removeClass('active'); tabContents.hide().filter(activeTab).fadeIn(); } return false; }); $(".tabbutton").click(function () { var nextTab = parseInt($("li.active").attr("id"), 10) + 1; if (nextTab === 4) { nextTab = 1; } tabs.removeClass("active"); $("#" + nextTab).addClass("active"); tabContents.hide(); $("#tab" + nextTab).fadeIn("slow"); }); }); </script> <script type="text/javascript" src="https://js.stripe.com/v1/"></script> <!-- jQuery is used only for this example; it isn't required to use Stripe --> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script type="text/javascript"> // this identifies your website in the createToken call below Stripe.setPublishableKey("<?php echo $stripe['publishable_key']; ?>"); function stripeResponseHandler(status, response) { if (response.error) { // re-enable the submit button $('.submit-button').removeAttr("disabled"); // show the errors on the form $(".payment-errors").html(response.error.message); } else { var form$ = $("#payment-form"); // token contains id, last4, and card type var token = response['id']; // insert the token into the form so it gets submitted to the server form$.append("<input type='hidden' name='stripeToken' value='" + token + "' />"); // and submit form$.get(0).submit(); } } $(document).ready(function() { $("#payment-form").submit(function(event) { // disable the submit button to prevent repeated clicks $('.submit-button').attr("disabled", "disabled"); // createToken returns immediately - the supplied callback submits the form if there are no errors Stripe.createToken({ number: $('.card-number').val(), cvc: $('.card-cvc').val(), exp_month: $('.card-expiry-month').val(), exp_year: $('.card-expiry-year').val() }, stripeResponseHandler); return false; // submit from callback }); }); <body> <ul class="tabs clearfix"> <li id="1"><a href="#tab1">Tab1</a></li> <li id="2"><a href="#tab2">Tab2</a></li> <li id="3"><a href="#tab3">Tab3</a></li> </ul> <div class="tab_container"> <div id="tab1" class="tab_content"> <form method="post"> <p> <label>Name:</label> <input type="text" name="name"> </p> <p> <label>Company:</label> <input type="text" name="company"> </p> <input type="submit" value="SAVE" class="tabbutton"/> </form> </div> <div id="tab2" class="tab_content"> <form id="payment-form" action="charge.php" method="post"> <h3>Purchase a quote by Oscar Wilde today! Only $535! Limited supply and going fast, buy now!!</h3> <!-- to display errors returned by createToken --> <span class="payment-errors"></span> <form action="charge.php" method="POST" id="payment-form"> <div class="form-row"> <label>Card Number</label> <input type="text" size="20" autocomplete="off" class="card-number" /> </div> <div class="form-row"> <label>CVC</label> <input type="text" size="4" autocomplete="off" class="card-cvc" /> </div> <div class="form-row"> <label>Expiration (MM/YYYY)</label> <input type="text" size="2" class="card-expiry-month"/> <span> / </span> <input type="text" size="4" class="card-expiry-year"/> </div> <button type="submit" class="submit-button">Buy!</button> </form> </form> </div> <div id="tab1" class="tab_content"> <p>Tab 3 Content Goes Here...</p> </div> </div> </body> </html> In Tab1 I'm saving data into database. Whenever user clicks on the save button the data needs to be saved into database and it will go to Tab2. I am successful while saving the data. My problem is it is not going to Tab2 after saving the data. When we click on the save button, the tab2 is just blinking but the page is still showing tab1 content. I want that whenever the user clicks on the save button the data needs to be saved in database and it will go to Tab2 content. Any suggestions?
  12. hello i got a problem with ajax-php that is including html file, javascript external file, php external file. now i got a problem give a value to button,button2,button3 when the php write the html code, but if the javascript or it wrote in the html file already the javascript is working fine, also jquery isn't working as well if the php create the html (div, textarea, input and br) code. what is the problem with the ajax-php version and why functions button_onload() and disabled_div_textarea_text2() not working well? first version-ajax-php version: (function button_onload() and function disabled_div_textarea_text2() isn't working in this version) here is the code of the html file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Language" content="he" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript" src="index.js"></script> <link rel="stylesheet" href="index.css" /> <!--<script src="jquery-2.0.3.min.js"></script>--> <title>textbox changing with ajax - php - version 1</title> <!-- javascript code --> <script language="JavaScript"> </script> </head> <body id='body'> <div id='div_textarea'></div> </body> </html> here is the code of the JavaScript file: try { /* ajax-php */ function ajax_php() { var str = new String; str = '1'; //alert('str2'); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } //alert('str3'); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById('div_textarea').innerHTML = xmlhttp.responseText; //document.getElementById('div_textarea').value = xmlhttp.responseText; //alert(xmlhttp.responseText); } } //alert('str4'); xmlhttp.open("POST","index.php?str=" + str, true); xmlhttp.send(); } /* fffff */ onload = function() { ajax_php(); /* load fuinctions */ /* --------------- */ button_onload(); clear_textarea1_2(); disabled_div_textarea_text2(); } /* fffff */ function button_onload() { /* first version */ /* ------------- */ document.getElementById('button').innerHTML = 'button 1'; document.getElementById('button2').value = 'button 2'; document.getElementById('button3').value = 'clear/clean'; } /* fffff */ function button() { /* show what the textarea inside text */ //alert(document.getElementById('div_textarea_text').value); document.getElementById('div_textarea_text2').value = document.getElementById('div_textarea_text').value; } /* fffff */ function button2() { /* show what the textarea inside text */ //alert(document.getElementById('div_textarea_text').value); document.getElementById('div_textarea_text2').value = document.getElementById('div_textarea_text').value; } /* textarea functions */ /* ------------------ */ /* fffff */ function clear_textarea1_2() { clear_div_textarea_text(); clear_div_textarea_text2(); } /* fffff */ function clear_div_textarea_text() { document.getElementById('div_textarea_text').value = ''; } /* fffff */ function clear_div_textarea_text2() { document.getElementById('div_textarea_text2').value = ''; } /* fffff */ function disabled_div_textarea_text2() { document.getElementById('div_textarea_text2').disabled = true; document.getElementById('div_textarea_text3').readOnly = true; } } catch(err) { txt='There was an error on this page.\n\n'; txt+='Error description: ' + err.message + '\n\n'; txt+='Click OK to continue.\n\n'; alert(txt); } here is the php code file: <?php $str1 = '<br />'; $str2 = '<textarea id="div_textarea_text"></textarea>'; $str3 = '<div id="button" onclick="button();"></div>'; $str4 = '<input type="button" onclick="button2();" id="button2" value="" />'; $str5 = '<textarea id="div_textarea_text2"></textarea>'; $str6 = '<input type="button" onclick="clear_textarea1_2();" id="button3" />'; $str7 = '<textarea id="div_textarea_text3"></textarea>'; echo($str1 . $str2 . $str1 . $str3 . $str1 . $str4 . $str1 . $str5 . $str1 . $str6 . $str1 . $str7); ?> but now take a look at this second version- php file with JavaScript: (php file and JavaScript file and working fine.) the php file code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Language" content="he" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript" src="index.js"></script> <link rel="stylesheet" href="index.css" /> <script src="jquery-2.0.3.min.js"></script> <title>textbox changing with php - version 2</title> <!-- javascript code --> <script language="JavaScript"> </script> </head> <body id='body'> <div id='div_textarea'> <?php $str1 = '<br />'; $str2 = '<textarea id="div_textarea_text"></textarea>'; $str3 = '<div id="button" onclick="button();"></div>'; $str4 = '<input type="button" onclick="button2();" id="button2" value="" />'; $str5 = '<textarea id="div_textarea_text2"></textarea>'; $str6 = '<input type="button" onclick="clear_textarea1_2();" id="button3" />'; $str7 = '<textarea id="div_textarea_text3"></textarea>'; echo($str1 . $str2 . $str1 . $str3 . $str1 . $str4 . $str1 . $str5 . $str1 . $str6 . $str1 . $str7); ?> </div> </body> </html> JavaScript file code: try { /* fffff */ onload = function() { /* load fuinctions */ /* --------------- */ button_onload(); clear_textarea1_2(); disabled_div_textarea_text2(); } /* fffff */ function button_onload() { /* first version */ /* ------------- */ document.getElementById('button').innerHTML = 'button 1'; document.getElementById('button2').value = 'button 2'; document.getElementById('button3').value = 'clear/clean'; } /* fffff */ function button() { /* show what the textarea inside text */ //alert(document.getElementById('div_textarea_text').value); document.getElementById('div_textarea_text2').value = document.getElementById('div_textarea_text').value; } /* fffff */ function button2() { /* show what the textarea inside text */ //alert(document.getElementById('div_textarea_text').value); document.getElementById('div_textarea_text2').value = document.getElementById('div_textarea_text').value; } /* textarea functions */ /* ------------------ */ /* fffff */ function clear_textarea1_2() { clear_div_textarea_text(); clear_div_textarea_text2(); } /* fffff */ function clear_div_textarea_text() { document.getElementById('div_textarea_text').value = ''; } /* fffff */ function clear_div_textarea_text2() { document.getElementById('div_textarea_text2').value = ''; } /* fffff */ function disabled_div_textarea_text2() { document.getElementById('div_textarea_text2').disabled = true; document.getElementById('div_textarea_text3').readOnly = true; } } catch(err) { txt='There was an error on this page.\n\n'; txt+='Error description: ' + err.message + '\n\n'; txt+='Click OK to continue.\n\n'; alert(txt); }
  13. <?php $user="root"; $password=""; $database="base"; $host="localhost"; $table="com"; mysql_connect($host, $user, $password) or die("error"); mysql_select_db($database) or die("error"); $name = $_POST['name']; $lastname = $_POST['lastname']; $email = $_POST['email']; $coment= $_POST['coment']; $error = ''; if(empty($name) || empty($lastname) || empty($email) || empty($coment)) { $error .= 'error. '; } if(!preg_match("/^[a-zA-A]+$/i", $name)) { $error .= 'Error '; } if(!preg_match("/^[a-zA-A]+$/i", $lastname)) { $error .= 'Error '; } if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", $email)) { $error .= 'errorl. '; } if(!preg_match("/^[a-zA-z0-9.,?!]+$/i", $comment)) { $error .= 'Error '; } if($error == '') { $result = "INSERT INTO com (name, lastname, email, coment) VALUES('$name', '$lastname', '$email','$coment')"; echo "<script type='text/javascript'>alert('Thanks.'); window.close();</script>";} else{ echo"<script type='text/javascript'>alert ('$error'); window.close(); </script>";} Errors seems to be working its just it won't insert data in table in mysql database.... Thank you so much.
  14. I built a custom templating class that uses DOMDocument to manipulate some of the nodes/tags within my html. I run into all kinds of problems when I use inline js (js that lives on page) Most notably with < and & used in the js itself. This code exibits some of the problems: $domStr = ' <!DOCTYPE html> <head> <meta charset="utf-8"/> <title>my page</title> <script> var elem = "<div>some content</div>"; </script> </head> <body> <div> MY PAGE </div> </body> </html> '; $doc = new DOMDocument(); libxml_use_internal_errors(true);//prevents tags in js from throwing errors; see php.net manual $doc->formatOutput = true; $doc->strictErrorChecking = false; $doc->preserveWhiteSpace = true; $doc->loadHTML($domStr); echo $doc->saveHTML(); exit; and the html output is: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>my page</title> <script> var elem = "<div>some content"; </script> </head> <body> <div> MY PAGE </div> </body> </html> You'll notice that the closing </div> tag is removed. ??? I have very dissapointed with domdocument overall as it doesn't seem to always do what it promises to do...even with preserving space/formatting etc. I'm to the point at which I might just abandon domdocument altogether and parst the html myself with regex (yuck) any expert advice in this matter would be greatly appretiated.
  15. Hello so I'm trying to make my own simple forum. How would can I do a quick quote/ reply to comment. Something WordPress would normally do with the #respond. I've done my own code and I can't seem to insert the code into a hidden input so that the users can't see the HTML codes that are outputted in the reply string. Generally, my code works fine and all, it's just that when someone clicks the "Quote" link, it literally inserts the actual HTML outputs into the textarea. I want something like WordPress' #respond command so that when someone hits the "Quote" link, it'll still quote the actual content the user is trying to respond to, but it'll also not output the HTML codes into the textarea. Here is my PHP code: <?php $reply = '<div style=\"border: 1px dashed\"><span style=\"text-transform: uppercase; font-family: Oswald, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: 300; margin: 0px 10px 0px 0px; width: 100%; color: #00A6EB;\">' . $row['username'] . '</span><p>' . $row['message'] . '</p></div><br /><br />'; ?> Here is my HTML code: <a href="#" onclick='insertext("<? echo $reply; ?>"); return false;'>Quote</a> Here is my Javascript code: <script type="text/javascript"> function insertext(text) { document.formname.messages.value += text + " "; document.formname.messages.focus(); } </script>
  16. HI. Can anyone help me. I've change the code here and there to make it works but failed. The problem is there is 2 files to be uploaded, but only the second one will display alert message, while the first one will just receive any file. EG: I try select the same file for both. But the first one does not respond while the second part respond that it is not the acceptable file extension. Here is the code. <script> function checkFile() { var node_list = document.getElementsByTagName('input'); for (var i = 0; i < node_list.length; i++) { var node = node_list[i]; if (node.getAttribute('type') == 'file') { var sFileName = node.value; var sFileExtension = sFileName.split('.')[sFileName.split('.').length - 1]; var iFileSize = node.files[0].size; var iConvert=(node.files[0].size/10485760).toFixed(2); } if (sFileExtension != "pdf" && sFileExtension != "doc" && sFileExtension != "docx" && iFileSize>10485760) { txt="File type : "+ sFileExtension+"\n\n"; txt+="Size: " + iConvert + " MB \n\n"; txt+="Please make sure your file is in pdf or doc format and less than 10 MB.\n\n"; alert(txt); } } } </script> my form, <input type="file" name="file" id="confirm" onchange="checkFile()"> <input type="file" name="file" id="approveletter" onchange="checkFile()"> Please help me...
  17. please help , I want the feild highlighted before 1 month till the expiry date.
  18. <!DOCTYPE html> <html> <head> <script> function HideComment() { document.GetElementById("comments").hide("textarea") } </script> </head> <body> <textarea name="" cols="" rows="" id="comments" onClick="">leave comment</textarea> </body> </html> i am trying to get the text area to hide when i click a button. this is what i have but doesnt seem to work. can someone help me?
  19. Hello. I'm having troubles disabling right click on images. The website shows the message that is supposed to be shown when I perform the right click, but also shows the right click menu (copy, save image as, etc.). What is the problem with this code (I'm not pasting the tags, only the "body" of the code)? var clickmessage="Clique com o botão direito desactivado nas imagens!" function disableclick(e) { if (document.all) { if (event.button==2||event.button==3) { if (event.srcElement.tagName=="IMG"){ alert(clickmessage); return false; } } } else if (document.layers) { if (e.which == 3) { alert(clickmessage); return false; } } else if (document.getElementById){ if (e.which==3&&e.target.tagName=="IMG"){ alert(clickmessage) return false } } } function associateimages(){ for(i=0;i<document.images.length;i++) document.images.onmousedown=disableclick; } if (document.all) document.onmousedown=disableclick else if (document.getElementById) document.onmouseup=disableclick else if (document.layers) associateimages()
  20. Try to keep this short. I have a monitor set up flipped so the resolution is 768px wide by 1360px tall. This is a touch device. Since my client didn't want to pay for me to develop an app for said touch device but wanted his websites just displayed as links (sites are responsive and local) I'm using Google Chrome to display these pages. They are all three HTML 5 and he's running XP so IE (not that I would have used it anyway) is out of the question. My problem is "Y" axis touch scrolling does not work with the drivers included with this touch device. So I've been looking for javascript solutions online. Tried tons of them. The only thing that seems to work is Zynga Easy Scroll. With the exception that it will only scroll to a certain point on the page then stops. It will not allow access to any information further down the page. My assumption is that the DOM I'm targeting has now scrolled too far up the page and I no longer have access to it. Currently though, that DOM is the body tag itself. I have also tried placing the entire page in a <div> with the scrollable applied to it but have the same results so applying it to the body tag isn't the issue. Anyone have experience with this javascript and have a solution for this not to bounce back and leave the bottom third of my page from displaying? I mean anything short of me starting all over using jquery mobile or Sencha Touch 2. Like I said, client doesn't want to pay for the time it would take for me to totally rebuild pages as an app. But those would just create an HTML 5 application anyway so don't see that even that's a solution with no "Y" axis scrolling ability. Thanks, Dave
  21. Hello all, I am trying to call two functions onclick of a submit button. the two functions inturn go to two php scripts..i want the php scripts to be run one after the other. But, its not working. Please take a look at my code and suggest some changes my html : <form method="post" action="" name="form"> <label> New Data set: </label> <input type="radio" name="url" value="NetOptInput2.html" id="ex1" required/> Yes <input type="radio" name="url" value="NetOptResult2.html" id="ex2" required/> No <br><br><br> <label>Dataset description: </label> <input type="text" name="dataset" id="field1" size="30" placeholder="" readonly><br><br><br> <label>Token Number : </label><input type="text" name="token" id="field2" size="6" placeholder="" readonly><br><br><br> <div style="text-align: center"><br> <input type="Submit" name="submit" value="Submit" class="submit" onclick="return(OnButton2() && OnButton1())"> <div class="spacer"></div> </form> My Javascript <!-- this function navigates user according to the radio button selection--> <script language="Javascript"> function OnButton1() { document.form.action = "Input1a.php" // document.form.target = "_blank"; // Open in a new window //document.form.submit(); // Submit the page // return true; } function OnButton2() { document.form.action = "Input1b.php" //document.form.target="_blank"; // document.form.submit(); // Submit the page // return true; } <!--This function disables the Token Number form if the user clicks "yes" radio button and disables Dataset if "No"--> <script type="text/javascript"> $(function(){ $("#ex1, #ex2").change(function(){ $("#field1, #field2").val("").attr("readonly",true); if($("#ex1").is(":checked")){ $("#field1").removeAttr("readonly"); $("#field1").focus(); } else if($("#ex2").is(":checked")){ $("#field2").removeAttr("readonly"); $("#field2").focus(); } }); }); MY php file1 if (isset($_POST) && $_POST['url1'] == "Yes") { header('Location: NetOptInput2.html'); } else if (isset($_POST) && $_POST['url2'] == "No") { header('Location: NetOptResult2.html'); } my php file 2 if (isset($_POST['submit'])) { $dataset = $_POST['dataset']; $tokennumber = $_POST['tokennumber']; $data = "$dataset | $tokennumber\n"; $file = "input.txt"; $fp = fopen($file, "w") or die("Couldn't open $file for writing!"); fwrite($fp, $data) or die("Couldn't write values to file!"); fclose($fp); $message = "Saved to $file successfully!"; }
  22. My code is, <?php function getreg($id) {return file_get_contents('http://arcbots.com/userinfo.php?id='.$id);} function getID($reg) {return file_get_contents('http://arcbots.com/userinfo.php?reg='.$reg);} function lastseen($user) {return file_get_contents('http://arcbots.com/userinfo.php?lastseen='.$user);} function getdisplayname($user) {return file_get_contents('http://arcbots.com/userinfo.php?displayname='.$user);} function gethomepage($user) {return file_get_contents('http://arcbots.com/userinfo.php?homepage='.$user);} function getavatar($user) {return file_get_contents('http://arcbots.com/userinfo.php?avatar='.$user);} function getuserinfo($user) {return file_get_contents('http://arcbots.com/userinfo.php?info='.$user);} ?> <center>This will search a users ID and return the Registered name</center> <html> <link rel="stylesheet" type="text/css" href="style.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="css/custom.css" /> <center><form method="post" /> <input type="text" name="search"> <input type="submit" value="get regname" name="submit"> </form></center> <?php function display() { echo getReg($_POST['search']); } if(isset($_POST["search"])) { display(); } ?> </html> I have two quick questions: 1 - How would I output the returned information it gives me in a popup window. side note: I'd like to keep the original output on the page just incase their browser blocks the popup. 2 - How would I create a usable dropdown menu that can select what function they want to use
  23. I am looking for a webdesigner / coder who can create the basic CSS for a fluid adaptive website. The main layout would be something like the 'Mondrian' example here http://designshack.net/articles/css/5-really-useful-responsive-web-design-patterns/ navigation design would be something like this. http://www.impressivewebs.com/demo-files/css3-glow-tabs/ At the moment I am too busy with different projects to spend a lot of time figuring out the new CSS possibilities and therefore I am looking for someone to help me. Please contact me by PM on phpfreaks thank you anatak
  24. Hello, I am currently developing a site but I have ran into a problem. The Google Maps is not rendering correctly and a grey area is visible. I have tried to use the resize facility initiated on window.onload and I have provided inline styling but to no avail. Any suggestion will be greatly appreciated. The Page with map implement can be found at http://www.esfdev.co.uk/bede/contact-us-and-lettings/find-us/ .Again and help will be greatly appreciated.
  25. my code below works perfect in Mozilla and Chrome but not in IE8, when i select a Radio button in IE its showing other options for other Radio button, need help in fixing the issue in IE8 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript" charset="utf-8"></script> <script src="jquery.chained.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <link rel="stylesheet" href="style.css" /> <script type="text/javascript" src="infratool.js"></script> <script> $(function() { $("#submit").hide(); $("#Category").change(function() { window.location = $(this).val().split(" ")[0]; if(loc) window.location.href = loc; }) }); </script> <table width="392" border="0"> <td colspan="2" align="center"><form id="form1" name="form1" method="post" action=""> <tr> <td align="center"> <label><input name="Radio1" type="radio" id="TestA" value="TestA" onclick="showSelect();" />TestA</label> <label><input name="Radio1" type="radio" id="TestB" value="TestB" onclick="showSelect();" />TestB</label> </td> </tr> </form> <div id="div-id" align="center"><select name="Category" id="Category" class="hide"> <option value=" TestA TestB" selected="selected">--</option> <option value="TestA1.php TestA">TestA1</option> <option value="TestA2.php TestA">TestA2</option> <option value="TestA3.php TestA">TestA3</option> <option value="TestA4.php TestA">TestA4</option> <option value="TestA5.php TestA">TestA5</option> <option value="TestB1.php TestB">TestB1</option> <option value="TestB2.php TestB">TestB2</option> <option value="TestB3.php TestB">TestB3</option> <option value="TestB4.php TestB">TestB4</option> <option value="TestB5.php TestB">TestB5</option> <option value="TestB6.php TestB">TestB6</option> </select><input type="submit" value="Go" id="submit"/> </div> </table> here are the other java scripts ive been using //Show Select option after clicking Radio button: function showSelect() { var select = document.getElementById('Category'); select.className = 'show'; } //Select option, separates the link from Class $(function(){ var select = $('#Category'), options = select.find('option'); $('[type="radio"]').click(function(){ var visibleItems = options.filter('[value*="' + $(this).val() + '"]').show(); options.not(visibleItems).hide(); if(visibleItems.length > 0) { select.val(visibleItems.eq(0).val()); } }); }); $(function() { $("#submit").hide(); $("#Category").change(function() { window.location = $(this).val().split(" ")[0]; if(loc) window.location.href = loc; }) }); and here is the screenshot in Firefox and IE8 respectively.
×
×
  • 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.