Mootools AJAX Request: Simple Example?

Discussion in 'Programming' started by mnymkr, Jul 19, 2008.

  1. #1
    I am fooling around with Mootools basically just to learn new stuff

    I have a script I used in a tutorial I wrote for Joomla so I wanted to see if I could apply it here

    I am just not quite sure how to post a request using Mootools and not have the page refresh

    
    echo '<form action=index.php method="get">
    Enter Letter<br />
    <input type="text" name="letter" />
    <input type="hidden" name="option" value="'.$option.'" />
    <input type="submit" class="button" id="button" value="submit" />
    </form>';
    
    $letter = JRequest::getVar ('letter' , a);
    
    $query ="SELECT a.* FROM #__content AS a WHERE a.title LIKE '$letter%'
    ";
    
    
    
    foreach ($rows as $article) {
    
    
    
    echo '<br />';
    
    $link = JRoute::_('index.php?option=com_content&id='.$article->id);
    
    echo '<a href="'.$link.'">'.$article->title.'</a>';
    
    echo '<br />';
    }
    
    ?>
    
    Code (markup):
    you can ignore some of the Joomla classes, just looking at the php

    how can I submit the letter and make the db results appear without refreshing

    any help that can help me see what is going on here will most appreicated

    you can see the code in joomla here

    http://www.bostondiamondexchange.com/beta/index.php?option=com_pagination&Itemid=3

    like i said my concern is making the request to the database and not having to refresh the page using mootools
     
    mnymkr, Jul 19, 2008 IP