Re: how to use an image for submit button via Ajax post

2007-07-02 Thread [EMAIL PROTECTED]

Hello,

I am having the same problem.
There is a submitImage for the formHelper but not for the ajaxHelper.
So I tried to make my own. But something doesn't work properly. It
doesn't give an error, but looses the data.
Any ideas?

// excerpt from the libs/views/helpers/ajax.php from version
1.2.0.5146alpha

function submitImage($path, $options = array()) {
if (strpos($path, '://')) {
$url = $path;
} else {
$url = $this-webroot(IMAGES_URL . $path);
}
$options['onclick'] = return false;;
if (!isset($options['id'])) {
$options['id'] = 'submit'. intval(rand());
}
return $this-output(sprintf($this-Html-tags['submitimage'], 
$url,
$this-_parseAttributes($options, null, '', ' ')))
.$this-Javascript-event('' . $options['id'] . '', 'click', 
$this-
remoteFunction($options));
}

Thanks
Casper


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to use an image for submit button via Ajax post

2007-05-08 Thread smitha

Hi,

I have a simple form that I'm trying to submit via an AJAX POST.  The
following works for me:


$ajax-submit('Submit', array('url' = 'add', 'update'
='task_todo'));


BUT I want to use an image for the submit button.  I don't want the
native browser submit buttons to be used.
Can anyone help me solve this.

Thanks,

Smitha


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---