View Single Post
  #5 (permalink)  
Old 05-13-2008, 11:33 PM
Aurheim Aurheim is offline
Junior Member
 
Join Date: May 2008
Posts: 8
Default

Quote:
Originally Posted by kuba View Post
sorry, but could you please explain us what are you really trying to achieve? a form?

have you ever had any contact with php? it seems to me that you are trying to do something, that is too hard for you.



what do you mean??
Your right, im trying to do something that is to hard for me. Yes I have programmed with PHP and other languages like javascript before, but are new to the Zend framework.

The problem is not that i have to learn javascrip or ajax, as a already do (but not as an expert). I just cant figure out how to connect the javascript part with the php part in the mvc framework or button events in the view part to php functions in the controller part.

What I have done so far is to make some pages in vcl for php framework without using ajax. This is because im supposed to test the responsetime to the pages. The pages uses standard controlls (editboxes, labels, listboxes etc.. )and db grids to display data. The user is able to se reactions on his screen while using the pages. In vcl I was able to set the properties to the elements on the form without using any javascript. It was just a PHP function and the pages had to refresh while changing status to checkboxes etc.

Now Im trying to make some pages in Zend framework that let the user test the responstime in a simular fasion (standard controlls, db table) without using ajax, but can not find any way to connect buttons and other controlls to any events like onchange, onclick etc. I just cant se how the framework expect me to use the view parts other than the post/get from any form. It should be possible to do some actions in php when a button, checkbox or other controlls are used without a formelement in the view. If I use javascript for this, how will I be able to run php functions as a result of that action?

Testing a possible solution with javascript events also went bad. I declared the onclick event for a button and made a javascript function in the head part under the script tags in the index.phtml, but somehow the function never is executed. Looking at the source code from the browser shows that my forms are not a part of the html body, but are rendered between body and html tag in the end of the page. Googling for examples was not easy ither since most of the examples was to complex or had focus on some ajax framework.

I guess what i need is some guidens or maby a example that is easy to understand.
Reply With Quote