Click here to Skip to main content
15,885,244 members
Home / Discussions / Web Development
   

Web Development

 
QuestionHow do I insert my own text into this script? Pin
Madaxe19-Dec-14 19:42
Madaxe19-Dec-14 19:42 
AnswerRe: How do I insert my own text into this script? Pin
Kornfeld Eliyahu Peter9-Dec-14 20:32
professionalKornfeld Eliyahu Peter9-Dec-14 20:32 
AnswerRe: How do I insert my own text into this script? Pin
S Services12-Dec-14 21:08
S Services12-Dec-14 21:08 
QuestionCan i cache all dynamically generated pages and serve them as pure HTML? Pin
Member 112915226-Dec-14 13:19
Member 112915226-Dec-14 13:19 
AnswerRe: Can i cache all dynamically generated pages and serve them as pure HTML? Pin
Anurag Gandhi31-May-15 2:37
professionalAnurag Gandhi31-May-15 2:37 
Questionvb 2010 web form sql control problem Pin
dcof4-Dec-14 10:17
dcof4-Dec-14 10:17 
AnswerRe: vb 2010 web form sql control problem Pin
Richard Deeming4-Dec-14 10:32
mveRichard Deeming4-Dec-14 10:32 
Questionadding jquery at a joomla's module backend code Pin
isengart3-Dec-14 23:04
isengart3-Dec-14 23:04 
Hello i made a module where i parse a bunch of names from the DB and i print em in a dropdownlist in the backend. Then i select some names and that names will be posted in the frontend.
I wanted to add an extra element (textbox) where it will print the count of the names i selected.
I wrote the code but i get a NULL value text box and no errors at consol.log . As the script is running at jsfiddle i suspect i have an error at including the library.
Im searching 2 days now with no luck.Could a joomla developer guru enlight me on what im doing wrong ?
my jquery script

JavaScript
jQuery(document).ready(function($){
                var count =$("#jform_params_foreignmanuf :selected").length;
                  $("#jform_params_manucounter").val(count);
              });


Multiselect Dropdown list:

PHP
{

        protected $type = 'Manulist';


        protected function getOptions()
        {

         $db= JFactory::getDbo();
         $query = $db->getQuery(true);
        $query->select('*');
        $query->from('#__virtuemart_manufacturers_en_gb');
        $db->setQuery($query);
         $items = $db->loadObjectList();
         $options = array();
         if ($items)
         {
          foreach($items as $item)
          {
            $options[] = JHtml::_('select.option', $item->virtuemart_manufacturer_id , $item->mf_name,$item->slug);
          }
         }
         $options = array_merge(parent::getOptions(), $options);
         JHtml::_('script', JUri::root() . 'modules/mod_manufacturers/js/js.js');
          

        }


}


Textbox Counter code:



PHP
<?php

defined('JPATH_PLATFORM') or die;
JFormHelper::loadFieldClass('Text');
class JFormFieldManulist extends JFormFieldText
{

        protected $type = 'Countermanu';


        protected function getOptions()
        {

        $doc = JDocument::getDocument();
       $js = '
             jQuery(document).ready(function($){
                 var count = $("#jform_params_foreignmanuf :selected").length;
                 $("#jform_params_manucounter").val(count);
             });
      ';
       $doc->addScriptDeclaration($js);
        JHtml::_('script', JUri::root() . 'modules/mod_manufacturers/js/js.js');

        }


}

QuestionEditing Elements Using Iframe Pin
MadDashCoder3-Dec-14 19:24
MadDashCoder3-Dec-14 19:24 
GeneralMessage Closed Pin
30-Nov-14 2:23
Janak197730-Nov-14 2:23 
GeneralRe: Next milestone in website development Pin
Dave Kreskowiak1-Dec-14 2:36
mveDave Kreskowiak1-Dec-14 2:36 
QuestionLearning & improving web application skills Pin
Angel Hermon27-Nov-14 8:18
Angel Hermon27-Nov-14 8:18 
QuestionPath to CSS Not Working Pin
MadDashCoder24-Nov-14 11:11
MadDashCoder24-Nov-14 11:11 
AnswerRe: Path to CSS Not Working Pin
User 171649224-Nov-14 13:18
professionalUser 171649224-Nov-14 13:18 
GeneralRe: Path to CSS Not Working Pin
MadDashCoder24-Nov-14 16:24
MadDashCoder24-Nov-14 16:24 
AnswerRe: Path to CSS Not Working Pin
MadDashCoder3-Dec-14 18:43
MadDashCoder3-Dec-14 18:43 
QuestionINSPIRATION FOR DESIGN Pin
Member 1122910913-Nov-14 12:16
Member 1122910913-Nov-14 12:16 
AnswerRe: INSPIRATION FOR DESIGN Pin
PIEBALDconsult13-Nov-14 12:41
mvePIEBALDconsult13-Nov-14 12:41 
GeneralRe: INSPIRATION FOR DESIGN Pin
Richard MacCutchan13-Nov-14 22:17
mveRichard MacCutchan13-Nov-14 22:17 
AnswerRe: INSPIRATION FOR DESIGN Pin
Kornfeld Eliyahu Peter13-Nov-14 22:54
professionalKornfeld Eliyahu Peter13-Nov-14 22:54 
AnswerRe: INSPIRATION FOR DESIGN Pin
Nathan Minier14-Nov-14 2:14
professionalNathan Minier14-Nov-14 2:14 
GeneralRe: INSPIRATION FOR DESIGN Pin
Shamim Reza14-Dec-14 4:25
Shamim Reza14-Dec-14 4:25 
AnswerRe: INSPIRATION FOR DESIGN Pin
Rollin Shultz19-Dec-14 5:16
Rollin Shultz19-Dec-14 5:16 
QuestionReport Viewer Configuration Error in RDLC Report Pin
Preety Shah12-Nov-14 3:25
Preety Shah12-Nov-14 3:25 
GeneralRe: Report Viewer Configuration Error in RDLC Report Pin
Sheepings13-Nov-14 4:21
professionalSheepings13-Nov-14 4:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.