To populate the selection box automatically with the first and last names of the students from the session, at the bottom of my watch page The code has been removed and to fill the name text box automatically with the value of the selected option from the font down list. But selecting the option from the list does not automatically fill the name. Please help me solve this problem.
$ javascript-> Link ('jquery-1.5.1.min .js'); $ Javascript-> Link (array ('jquery', 'form')); $ Max_students = $ this- & gt; Session-> Read ('student_count'); $ Student_name = array (); $ Student_name [] = "- Choose -"; ($ I = 0; $ i & lt; $ max_students; $ i ++) {$ student_first_name = $ this- & gt; Session-> Read ('Student. $ I.'. FirstName '); $ Student_last_name = $ this- & gt; Session-> Read ('student.' $ I. 'LastName'); $ Student_name [] = ($ student_first_name. "". $ Student_last_name); } $ SelectDomId = $ this- & gt; Form- & gt; DomId ('student'); $ FirstnameDomId = $ this- & gt; Form- & gt; DomId ('name'); $ This- & gt; HTML-> Change (function (event) {$ ('# $ $ firstnameDomId}'). Val ($ (this) .val ()) ;});}); "Array ('inline' = & gt; wrong)); Echo $ this-> Form- & gt; Create ('Contacts', Arrays ('Controller' = & gt; 'Contact', 'Action' => 'Impact')); Echo "& lt; strong> just as & lt; / strong & gt;"; Echo $ the-> Form- & gt; Select ('student', $ student_name, $ this- & gt; form-> domId (array (), 'student')); Echo $ the-> Form- & gt; Input ('name');
I do not really have any answers for you - but are you able to firebug Or use some kind of developer tool to find out that when you change the value of the select control, any JavaScript errors are thrown away? You should also keep an eye on the generated HTML source for the page to ensure that the script code was generated correctly. To ensure that your call is also, try entering a debugging statement in your Javascript function:
$ this-> HTML-> Change (function ($) ($ ('# $ $ firstnameDomId}'). Val ($ (this) .val ()) ;}); Warning ('test');}); ", array ('inline' = & gt; wrong));
Comments
Post a Comment