modalbox javascript onclose event

Today after along period writing a post. I tried a new javascript library called modalbox js. Was working very good, but i had to run other javascript when the box was closed. Found some help at http://code.google.com/p/modalbox/wiki/MethodsReference but didn’t found the exact syntax.

After some trial and error finally succeeded, so thought to post on to the blog. Here is the syntax for javascript as well as for symfony (in case you are working with symfony)

Syntax for symfony:

<?php echo m_link_to(‘link_name’,
‘url’,
array(‘title’ => ‘title’),
array(‘width’ => 630, ‘height’ => 180, ‘afterHide’ => ‘afterhidealert‘)); ?>

here afterhidealert is the javascript function that will be called on the closing of the modalbox popup.

Syntax for javascript:

<a href=”url” onclick=”Modalbox.show(this.href, {afterHide:afterhidealert, height:180, title:this.title, width:630}); return false;” title=”title”>link_name</a>

here afterhidealert is the javascript function that will be called on the closing of the modalbox popup.

Thanks,

samsami2u

http://www.avidindiainc.com

Advertisements

Couldn’t get short alias for (

The below query didn’t worked for me and gave me the error “Couldn’t get short alias for ( re” and so i did removed the spaces from between every ‘or’ and brackets ‘(‘. i have added the modified query below the original query.

$restaurant = Doctrine_Query::create()
->select(‘re.*’)
->from(‘ReservationHoursSetting re’)
//->where(“re.id <> ? AND re.reservation_setting_id = ? AND ( (re.hr_from > {$hourFrom} AND re.hr_from < {$hourTo}) OR (re.hr_to > {$hourFrom} AND re.hr_to < {$hourTo}) )”, array($HourID, $restaurantSettingID) )
//->where(“re.id <> ? AND re.reservation_setting_id = ? AND ( ( re.hr_from BETWEEN {$hourFrom} AND {$hourTo} ) OR ( re.hr_to BETWEEN {$hourFrom} AND {$hourTo} ) OR ( {$hourFrom} BETWEEN re.hr_from AND re.hr_to )  OR ( {$hourTo} BETWEEN re.hr_from AND re.hr_to ) )”, array($HourID,$restaurantSettingID) )
->where(“re.id <> ? AND re.reservation_setting_id = ? “, array($HourID,$restaurantSettingID) )
->andWhere(“((re.hr_from > {$hourFrom}  AND re.hr_from< {$hourTo})

OR (re.hr_to > {$hourFrom} AND re.hr_to < {$hourTo})

OR (re.hr_to > {$hourFrom}  AND re.hr_from < {$hourFrom})

OR (re.hr_to < {$hourTo}  AND re.hr_from > {$hourTo})

OR (re.hr_to = {$hourTo}  AND re.hr_from = {$hourFrom}))”)
->fetchArray();

====================

$restaurant = Doctrine_Query::create()
->select(‘re.*’)
->from(‘ReservationHoursSetting re’)
//->where(“re.id <> ? AND re.reservation_setting_id = ? AND ( (re.hr_from > {$hourFrom} AND re.hr_from < {$hourTo}) OR (re.hr_to > {$hourFrom} AND re.hr_to < {$hourTo}) )”, array($HourID, $restaurantSettingID) )
//->where(“re.id <> ? AND re.reservation_setting_id = ? AND ( ( re.hr_from BETWEEN {$hourFrom} AND {$hourTo} ) OR ( re.hr_to BETWEEN {$hourFrom} AND {$hourTo} ) OR ( {$hourFrom} BETWEEN re.hr_from AND re.hr_to )  OR ( {$hourTo} BETWEEN re.hr_from AND re.hr_to ) )”, array($HourID,$restaurantSettingID) )
->where(“re.id <> ? AND re.reservation_setting_id = ? “, array($HourID,$restaurantSettingID) )
->andWhere(“((re.hr_from > {$hourFrom}  AND re.hr_from< {$hourTo}) OR (re.hr_to > {$hourFrom} AND re.hr_to < {$hourTo}) OR (re.hr_to > {$hourFrom}  AND re.hr_from < {$hourFrom}) OR (re.hr_to < {$hourTo}  AND re.hr_from > {$hourTo}) OR (re.hr_to = {$hourTo}  AND re.hr_from = {$hourFrom}))”)
->fetchArray();