all right, let me rephrase:
the page that i'm working with has a link that when you click on it,
it gives you a random single result. this i have no problems with. The
problem is that i also have a form in that same page that allows you
to add to the database. Below the form i have a div that shows all the
results. Because some people told me to (and i agree) i put a link
that toggles the div so that if you want to see it, you can but if you
dont care, it doesn't take up screen real estate. The default is to
hide it. The problem is that i want to update the div when the button
of the form is clicked.
the controller has four actions. the random part is generated by using
ajax and using an action called random. i have an action called add
that is used to save results from the form. since the form is in
index.thtml and the controller action is in function add() {} the form
looks like this:
<form method="post" id="frmAdd" class="addForm">
text field
echo $ajax->submit('Add', array('class' => 'submitButton', 'update' =>
'holder'));
*** there is a div around the form field named holder
i had to do it this way because otherwise the validation errors would
not work. i'm pretty sure the reason it didn't work is because the
tagerrormsg only works when it is in add.thtml.
the problem is that i want to update both the holder div and the div
where i show all the results, but i don't know how. holder div
displays add.thtml so it shows any errors and uses the add action from
the controller. the other div, the one that shows all the results,
uses another action in that controller.
so basically, i need a way to update two divs that use different
controllers when pressing the submit button.
hopefully that is more clear.
thanks for any help.
On Oct 15, 6:25 pm, "Wayne Fay" <[EMAIL PROTECTED]> wrote:
> Your original email is not clear. Its one huge clump of text that just
> rambles on.
>
> Break it up into short 2-3 sentence paragraphs. And be more clear with
> what you have, what is happening, and what you want. Perhaps someone
> will respond more positively to that.
>
> Wayne
>
> On 10/15/07,d34db0lts<[EMAIL PROTECTED]> wrote:
>
>
>
> > i tried fixing my problem by using this article:
>
> >http://bakery.cakephp.org/articles/view/rails-like-data-validation
>
> > unfortunately, it didn't help, i'm having issues with the helper...can
> > anybody shed some light? some hope???
> > On Oct 14, 8:09 pm,d34db0lts<[EMAIL PROTECTED]> wrote:
> > > Hey guys, i have this little app that i'm having problems with.
>
> > > the index page lists all the records but in that same index page there
> > > is a form that uses function add in the controller to process the
> > > form, but my problem is that i need a way to display if the user
> > > forgot to enter anything in the input field. i've been looking around
> > > at it seems like the way it is done is with a tagErrorMsg but like i
> > > said, the form is in index.thtml but the form logic is in function
> > > add()...so i can't have function add() tell funcion index() to display
> > > a message to the user to remind him/her to enter something in the
> > > input field.
>
> > > i've looked at requestAction and elements, but i can't come up with an
> > > answer...so if anybody can point me in the right direction, i would
> > > really appreciate it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---