Jump to content

Search the Community

Showing results for tags 'javascript'.



More search options

  • 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 (Dreamweaver, Zend, 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

Found 57 results

  1. If you try this link https://jsfiddle.net/u4bxz74c/10/. Later the result will be like this PART 1 <p id="posttextareadisplay"> <p class="ENGLISH">This is a samplasde textssss</p> <p class="ENGLISH"><b>فَإِذَا جَلَسْتَ فِي وَسَطِ الصلَاةِ فَاطْمَئِن، وَافْتَرِشْ فَخِذَكَ الْيُسْرَى ثُم تَشَهدْ</b></p> </p> PART 2 <p id="posttextareadisplay"> <p class="ENGLISH">This is a samplasde textssss <b>فَإِذَا جَلَسْتَ فِي وَسَطِ الصلَاةِ فَاطْمَئِن، وَافْتَرِشْ فَخِذَكَ الْيُسْرَى ثُم تَشَهدْ</b></p> </p> Question PART 1 : If you see the code below, all paragraphs or <p> are class="ENGLISH". How to make it into a paragraph or <p> class="ENGLISH" to be class="ARAB", if the writing in a paragraph is Arabic? But if the writing is not Arabic, so the paragraph of class="ENGLISH" PART 1 <p id="posttextareadisplay"> <p class="ENGLISH">This is a samplasde textssss</p> <p class="ENGLISH"><b>فَإِذَا جَلَسْتَ فِي وَسَطِ الصلَاةِ فَاطْمَئِن، وَافْتَرِشْ فَخِذَكَ الْيُسْرَى ثُم تَشَهدْ</b></p> </p> ***** I WANT TO BE LIKE THIS ******* <p id="posttextareadisplay"> <p class="ENGLISH">This is a samplasde textssss</p> <p class="ARAB"><b>فَإِذَا جَلَسْتَ فِي وَسَطِ الصلَاةِ فَاطْمَئِن، وَافْتَرِشْ فَخِذَكَ الْيُسْرَى ثُم تَشَهدْ</b></p> </p> Question PART 2 : But if the Arabic joins with plain writing or regular fonts. So paragraph or <p> remain class="ENGLISH" Like this <p class="ENGLISH"> This is a sa <b> لْيُسْرَى ثُم تَشَهدْ</b></p> <p class="ENGLISH"><b> لْيُسْرَى ثُم تَشَهدْ</b> This is a sa</p> <p class="ENGLISH"> This is a sa <b> ا لْيُسْرَى ثُم تَشَهدْ</b> This is a sa</p> <p class="ENGLISH"><b> لْيُسْرَى ثُم تَشَهدْ</b> This is a sa <b> لْيُسْرَى ثُم تَشَهدْ</b></p> Note: I've tried this code, but it seems, this code encapsulates the entire contents of the textarea if (pattern.test(newText)) { str = newText.replace($format_search[i], $arab_format_replace[i]); } else { str = newText.replace($format_search[i], $format_replace[i]); }
  2. I'm trying to add owl carousel for each bootstrap tab. Carousel in the first tab is loading perfectly, but when user clicks on second tab, owl carousel items are not loading. That mean on second tab it displays empty space instead of displaying carousel items. My HTML is something like this: <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#female" aria-controls="female" role="tab" data-toggle="tab">Female</a></li> <li role="presentation"><a href="#male" aria-controls="male" role="tab" data-toggle="tab">Male</a></li> </ul> <!-- Tab panes --> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="female"> <div data-items="1" data-lg-items="7" data-margin="20" class="owl-carousel" data-autoplay='false'> <div> <a href="#"> <div> <img src="images/profile/profile1.jpg" alt="" class="img-responsive center-block"> </div> </a> </div> <div> <a href="#"> <div> <img src="images/profile/profile2.jpg" alt="" class="img-responsive center-block"> </div> </a> </div> <div> <a href="#"> <div> <img src="images/profile/profile3.jpg" alt="" class="img-responsive center-block"> </div> </a> </div> </div> </div> <div role="tabpanel" class="tab-pane" id="male"> <div data-items="1" data-lg-items="7" data-margin="20" class="owl-carousel" data-autoplay='false'> <div> <a href="#"> <div> <img src="images/profile/profile1.jpg" alt="" class="img-responsive center-block"> </div> </a> </div> <div> <a href="#"> <div> <img src="images/profile/profile2.jpg" alt="" class="img-responsive center-block"> </div> </a> </div> <div> <a href="#"> <div> <img src="images/profile/profile3.jpg" alt="" class="img-responsive center-block"> </div> </a> </div> </div> </div> </div> This is my JS looks like: var plugins = { bootstrapTabs: $(".tabs"), owl: $(".owl-carousel") }; if (plugins.owl.length) { var i; for (i = 0; i < plugins.owl.length; i++) { var c = $(plugins.owl[i]), responsive = {}; var aliaces = ["-", "-xs-", "-sm-", "-md-", "-lg-"], values = [0, 480, 768, 992, 1200], j, k; for (j = 0; j < values.length; j++) { responsive[values[j]] = {}; for (k = j; k >= -1; k--) { if (!responsive[values[j]]["items"] && c.attr("data" + aliaces[k] + "items")) { responsive[values[j]]["items"] = k < 0 ? 1 : parseInt(c.attr("data" + aliaces[k] + "items")); } if (!responsive[values[j]]["stagePadding"] && responsive[values[j]]["stagePadding"] !== 0 && c.attr("data" + aliaces[k] + "stage-padding")) { responsive[values[j]]["stagePadding"] = k < 0 ? 0 : parseInt(c.attr("data" + aliaces[k] + "stage-padding")); } if (!responsive[values[j]]["margin"] && responsive[values[j]]["margin"] !== 0 && c.attr("data" + aliaces[k] + "margin")) { responsive[values[j]]["margin"] = k < 0 ? 30 : parseInt(c.attr("data" + aliaces[k] + "margin")); } } } c.owlCarousel({ autoplay: c.attr("data-autoplay") === "true", loop: c.attr("data-loop") !== "false", items: 1, dotsContainer: c.attr("data-pagination-class") || false, navContainer: c.attr("data-navigation-class") || false, mouseDrag: "false", nav: c.attr("data-nav") === "true", dots: c.attr("data-dots") === "true", dotsEach: c.attr("data-dots-each") ? parseInt(c.attr("data-dots-each")) : false, animateIn: c.attr('data-animation-in') ? c.attr('data-animation-in') : 'fadeIn', animateOut: c.attr('data-animation-out') ? c.attr('data-animation-out') : 'fadeOut', responsive: responsive, navText: [] }); } $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { e.target // newly activated tab e.relatedTarget // previous active tab $(".owl-carousel").trigger('refresh.owl-carousel'); }); } So can anybody tell me how to fix this issue? Hope somebody may help me out. Thank you.
  3. I have a single Form which allows user to create a new Gift Voucher record. It is split into 3 input areas Voucher Details, Payment Details and Delivery Details. ​ I want to add a button on the Payment details section which when activated will copy some of the entered fields from the Payment section to some of the fields in the Delivery section as follows: - FROM PAYMENT SECTION TO DELIVERY SECTION PurchaserName DeliveryName PAddressLine1 DAddressLine1 PAddressLine2 DAddressLine2 PCounty DCounty PPostCode DPostCode I am using a Code Building product called PHP Runner which when you add a button gives you a properties widget as per attachment in which to place your bespoke code.
  4. Can some one help to generate a unique Doctor Appointment ID when some one save the registration form, I am trying to make online doctor appoint booking system, I want something like for each doctor, each date, it will generate a unique id, that may be something like following Dr_ID-Date-Auto increment number( DR001-03-23-2016-0001 ) If any one have better idea to generate a short and unique id, please suggest me. I am a beginner in PHP, please help me guys
  5. I am working with the code from this: https://codepen.io/adventuresinmissions/pen/nrhHF I have made my own slight changes, but I am having a problem. I am getting data from a mysql table. If the page has more than one element (or row) from the table shown it will pop up the popup for each - if hitting "No" or "Cancel". I just want it to show one pop up and go away. Not go to the next pop up/row. Hope that makes sense. The Code I am Using on the Page: ECHO<<<END <script> jQuery(document).ready(function($){ //open popup $('.cd-popup-trigger$count').on('click', function(event){ event.preventDefault(); $('.cd-popup').addClass('is-visible'); }); //close popup $('.cd-popup').on('click', function(event){ if( $(event.currentTarget).is('.cd-popup-close') || $(event.currentTarget).is('.cd-popup') ) { event.preventDefault(); $(this).removeClass('is-visible'); } }); //close popup when clicking the esc keyboard button $(document).keyup(function(event){ if(event.which=='27'){ $('.cd-popup').removeClass('is-visible'); } }); }); </script> <style> .img-replace { /* replace text with an image */ display: inline-block; overflow: hidden; text-indent: 100%; color: transparent; white-space: nowrap; } .cd-popup { position: fixed; left: 0; top: 0; height: 100%; width: 100%; background-color: rgba(94, 110, 141, 0.9); opacity: 0; visibility: hidden; -webkit-transition: opacity 0.3s 0s, visibility 0s 0.3s; -moz-transition: opacity 0.3s 0s, visibility 0s 0.3s; transition: opacity 0.3s 0s, visibility 0s 0.3s; } .cd-popup.is-visible { opacity: 1; visibility: visible; -webkit-transition: opacity 0.3s 0s, visibility 0s 0s; -moz-transition: opacity 0.3s 0s, visibility 0s 0s; transition: opacity 0.3s 0s, visibility 0s 0s; } .cd-popup.show_button { opacity: 1; visibility: visible; -webkit-transition: opacity 0.3s 0s, visibility 0s 0s; -moz-transition: opacity 0.3s 0s, visibility 0s 0s; transition: opacity 0.3s 0s, visibility 0s 0s; display: block; height: 60px; line-height: 60px; text-transform: uppercase; color: #FFF; -webkit-transition: background-color 0.2s; -moz-transition: background-color 0.2s; transition: background-color 0.2s; } .cd-popup-container { position: relative; width: 90%; max-width: 400px; margin: 4em auto; background: #FFF; border-radius: .25em .25em .4em .4em; text-align: center; box-shadow: 0 0 20px rgba(0, 0, 0, 0.2); -webkit-transform: translateY(-40px); -moz-transform: translateY(-40px); -ms-transform: translateY(-40px); -o-transform: translateY(-40px); transform: translateY(-40px); /* Force Hardware Acceleration in WebKit */ -webkit-backface-visibility: hidden; -webkit-transition-property: -webkit-transform; -moz-transition-property: -moz-transform; transition-property: transform; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; transition-duration: 0.3s; } .cd-popup-container p { padding: 3em 1em; } .cd-popup-container .cd-buttons:after { content: ""; display: table; clear: both; } .cd-popup-container .cd-buttons li { float: left; width: 50%; list-style: none; } .cd-popup-container .cd-buttons a { display: block; height: 60px; line-height: 60px; text-transform: uppercase; color: #FFF; -webkit-transition: background-color 0.2s; -moz-transition: background-color 0.2s; transition: background-color 0.2s; } .cd-popup-container .cd-buttons li:first-child a { background: #fc7169; border-radius: 0 0 0 .25em; } .no-touch .cd-popup-container .cd-buttons li:first-child a:hover { background-color: #fc8982; } .cd-popup-container .cd-buttons li:last-child a { background: #b6bece; border-radius: 0 0 .25em 0; } .no-touch .cd-popup-container .cd-buttons li:last-child a:hover { background-color: #c5ccd8; } .cd-popup-container .cd-popup-close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; } .cd-popup-container .cd-popup-close::before, .cd-popup-container .cd-popup-close::after { content: ''; position: absolute; top: 12px; width: 14px; height: 3px; background-color: #8f9cb5; } .cd-popup-container .cd-popup-close::before { -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); left: 8px; } .cd-popup-container .cd-popup-close::after { -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); right: 8px; } .is-visible .cd-popup-container { -webkit-transform: translateY(0); -moz-transform: translateY(0); -ms-transform: translateY(0); -o-transform: translateY(0); transform: translateY(0); } @media only screen and (min-width: 1170px) { .cd-popup-container { margin: 8em auto; } } </style> END; $stmt = $mysqli->prepare("SELECT state_name FROM states WHERE state_code = ?"); $stmt->bind_param('s', $state_code); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($state_name); $stmt->fetch(); $stmt->close(); $stmt2 = $mysqli->prepare("SELECT toll, crime_rate, traffic, population, city, state_code, latitude, longitude, last_updated FROM states_cities WHERE `zip` = ?"); $stmt2->bind_param('i', $zip); $stmt2->execute(); $stmt2->store_result(); $stmt2->bind_result($toll, $crime_rate, $traffic, $population, $city, $state, $lat_to, $lon_to, $last_updated); $stmt2->fetch(); $stmt2->close(); echo "<h1>$city, <a href=\"state_details.php?state=$state_code\">$state_name</a></h1>"; if ($rank >= 10) { $stmt3 = $mysqli->prepare("SELECT latitude, longitude FROM states_cities WHERE zip = ?"); $stmt3->bind_param('i', $user_zip); $stmt3->execute(); $stmt3->store_result(); $stmt3->bind_result($lat_from, $lon_from); $stmt3->fetch(); $stmt3->close(); $travel_time = get_distance($lat_to, $lat_from, $lon_to, $lon_from); echo "Distance: $travel_time[distance] | Travel Time: $travel_time[time]"; } else { $travel_time = ""; } if($rank == 20) { if ((!empty($toll))) { //Add form to EDIT FORM city information } else { //Add form to ADD FORM city information to site } } if ($rank >= 18) { echo "<center><a href=\"attractions/index.php?state=$state_code\">Add Attraction</a> | <a href=\"stores/index.php?state=$state_code\">Add Store</a></center>"; } $stmt = $mysqli->prepare("SELECT name, price, free, parking_fee, discount, hours_daily, hours_weekend, address, city, zip, attract_id FROM states_attractions WHERE (city = ? OR zip = ?) AND `state` = ?"); $stmt->bind_param('sis', $city, $zip, $state_code); $stmt->execute(); $stmt->store_result(); $num_attracts = $stmt->num_rows; $stmt->bind_result($name, $price, $free, $parking_fee, $discount, $hours_daily, $hours_weekend, $address, $city, $zip, $attract_id); if ($num_attracts >= 1) { echo "<h2>Attractions</h2>"; //$count = 0; while ($stmt->fetch()) { //$count++; if ((!empty($parking_fee)) || ($parking_fee != "0.00")) { $total = $price + $parking_fee; $show_fee = " + $$parking_fee ($$total)"; } else { $show_fee = ""; } if ($rank >= 18) { $show_admin = " | <a href=\"attractions/edit.php?id=$attract_id\">EDIT</a> | <a href=\"\" class=\"cd-popup-trigger\"><font color=\"red\">DELETE</font></a>"; echo " <div class=\"cd-popup\" role=\"alert\"> <div class=\"cd-popup-container\"> <p>Are you sure you want to delete this attraction?</p> <ul class=\"cd-buttons\"> <li><a href=\"attractions/delete.php?id=$attract_id\">Yes</a></li> <li><a href=\"#0\" class=\"cd-popup-close\">No</a></li> </ul> <a href=\"#0\" class=\"cd-popup-close img-replace\">Close</a> </div> <!-- cd-popup-container --> </div> <!-- cd-popup -->"; } else { $show_admin = ""; } if ($rank >= 10) { $show_user = " | <a href=\"addtotrip.php?id=$attract_id\">ADD TO TRIP</a>"; } else { $show_user = ""; } if (!empty($discount)) {$show_discount = " Discount: $discount";} else {$show_discount = "";} if ($free == "yes") {$final_price = "FREE";} else {$final_price = "$$price";} $url_address = urlencode($address); $url_city = urlencode($city); echo "<div class=\"link_desc\">$name<sub>$final_price$show_fee $show_discount | Daily Hours: $hours_daily | Weekend Hours: $hours_weekend | <a href=\"http://maps.google.com/maps?q=$url_address,+$url_city,+$zip\" target=\"_blank\">$address, $city, $zip</a>$show_user$show_admin</sub></div>"; } } $stmt->close();
  6. Hello, I could not figure wether this question should be posted in the javascript forum or here. I am building a simple blog commenting application that displays a comment reply box whose textarea has a dynamically generated ID when a reply link is clicked Take a look at my html code below: <div> <div> Some message over here </div> <div style = "height:10px;"> <a class="reply" id="myHeader1" href="javascript:showonlyone('newboxes1');" >Reply</a></div> </div> <div class ="replymsgbox" id="newboxes1"> <form method="POST"> <textarea id="" class="content"></textarea> </form> </div> <div> <div> Some message over here </div> <div style = "height:10px;"> <a class="reply" id="myHeader2" href="javascript:showonlyone('newboxes2');" >Reply</a></div> </div> <div class="replymsgbox" id="newboxes2"> <form method="POST"> <textarea id="" class="content" ></textarea> </form> </div> And this is the javascript dynamically generating the ID: The javascript script below uses the parent(); children() and next() jquery methods to traverse the DOM and select the textarea element of the displayed form so as to assign the 'ID attribute' to it. <script type="text/javascript"> $('a.reply').on("click", function(e){ $(this).parent("div").parent("div").next("div").children('form').children('textarea').attr( "id", "ckeditor" ); }); </script> When the reply link is clicked, the comment box with a form is toggled using the jquery show() and hide() functions. See code snippet below: <script src="views/js/jquery-1.11.2.min.js" type="text/javascript"></script> <script type="text/javascript"> function showonlyone(thechosenone) { $('.replymsgbox').each(function(index) { if ($(this).attr("id") == thechosenone) { $(this).show(200); } else { $(this).hide(600); } }); } </script> I then wish to replace the dynamic (textarea id="comment") with a CKEditor instance using the code below: <script src="libraries/ckeditor/ckeditor.js"></script> <script type="text/javascript"> $(document).ready(function() { if(CKEDITOR) { // Replace the <textarea id= "ckeditor"> with a CKEditor instance. CKEDITOR.replace('ckeditor'); } }); </script> However, when I toggle the comment form, (the id="ckeditor") attribute is assigned, but what appears is a simple textarea not with ckeditor enabled on it. How can I make each new dynamically created textareas use CKeditor? or Why is the CKEDITOR replace() method not detecting the textarea ID? Perhaps someone here may have any clues? Note: that when I hardcode the id='ckeditor' attribute value pair into any of the text areas, that textarea is converted into a rich text editor.
  7. Hello Mate, I would like to seek help... i have this json script which gets the names of the users from my database: $sql=mysql_query("SELECT firstname FROM tblusers WHERE usertype=1"); $u = array(); while($rs=mysql_fetch_array($sql)){ $u[] = $rs['firstname']; } print json_encode($u); And getting this to javascript function through ajax: function uList(){ $.ajax({ type: "POST", url: "techs.php", success: function(data) { console.log(data); return data; } }); } my console.log shows the correct format i want to get, but it doesn't display on my calendar page.... ["user1","user2","user3","user4","user5"]... im using this code to send data to my calendar script. users:uList, Any help is very much appreciated. Thank you
×
×
  • 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.