1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Joomla and jquery simple question

Discussion in 'jQuery' started by schlogo, Sep 10, 2014.

  1. #1
    Hello

    Here s a simple question, could someone tell me what is the use of the last part of this line of code ?

    jQuery("#city").val(panels[<?php echo $this->work->fk_panel_id;?>].city_id);
    Code (markup):
    I know it sets the value of the city dropdown box. My question is to roughly know what it is doing exactly ?

    It assigns a value to city but what is panels supposed to be ? an array ? what is .city_id used for at the end.

    You ll understand i have no jquery background , tks for your answer
     
    Solved! View solution.
    schlogo, Sep 10, 2014 IP
  2. #2
    Its setting the input#city with the value of the city_id from the panels object which matches the fk_panel_id. You have pretty much answered this yourself.
     
    HuggyStudios, Sep 10, 2014 IP
    schlogo likes this.
  3. schlogo

    schlogo Well-Known Member

    Messages:
    1,615
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    140
    #3
    thanks, i was not too sure about this !
     
    schlogo, Sep 10, 2014 IP