Tuesday, February 24, 2009

Re: Submit using image

Thanks for your insight. I was actually messing around and came up
with something that works so I will share what I came up with in case
you ever want to give it a try. Not sure if it's a hack or what but
this is what ended up working.
By adding array('value'=>'') where the title would normally go works
perfect and the form submits AJAX perfectly.

<?php echo $ajax->submit(array('value'=>''), array(
'url' => '............',
'update' => '.........',
'class' => 'save_btn',
'loading'=> '............',
'loaded'=> '............',
'complete' => '...........'
));?>

Thanks again,

Dave


On Feb 25, 12:10 am, Graham Weldon <gra...@grahamweldon.com> wrote:
> Hey,
>
> The method I use workds really well on all browsers, and is achieved with
> CSS:
>
> .save_btn {
>    background: #fff url(../img/myimage.png) top left no-repeat;
>    width: 70px;
>    height: 20px;
>    padding-top: 20px;
>    overflow: hidden;
>
> }
>
> If your image is a 70 pixel by 20 pixel button for a single sprite, this
> essentially shows the backgorund image in place, while hiding overflow, and
> pushing your text outside its display area. This is also a useful image
> replacement technique for headings and such too.
>
> Give it a go, and let me know how it works out.
>
> Cheers,
> Graham Weldon.
>
> On Tue, 24 Feb 2009 18:56:47 -0800 (PST), WidePixels <d...@widepixels.com>
> wrote:
>
> > What I have been trying to do is use an image to submit the AJAX form.
> > Thing is I am using a  CSS sprite as the image so i have the hover and
> > other button states in the CSS. the actual image(s) are in the CSS and
> > not physically linked to the submit. I have the class added fine to
> > the submit link, but the 'SAVE' text shows up over my CSS button.
>
> > So basically i need to have the $caption for the link not display.
>
> > link:
> > <?php echo $ajax->submit('save', array(
> >                                            'url' =>'.....',
> >                                            'update' => '......',
> >                                            'class' => 'save_btn',
> >                                            'loading'=> '........',
> >                                            'complete' => '..........'
> > ));?>
>
> > Ideas, suggestions?
>
> > Thanks,
> > Dave
>
> --
> Cheers,
>
> Graham Weldon
> w.http://grahamweldon.com
> e. gra...@grahamweldon.com
> p. +61 407 017 293
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: