This topic is locked
[SOLVED]

 Getting Custom Dropdown value to Before record updated event

10/10/2014 5:56:35 PM
PHPRunner General questions
S
smith author

This is my dropdown script for the php snippet in the LIST PAGE

I wanted to get the dropdown selected values in the Before record updated event of INLINE EDIT


//create dropdown
$str = "";

$str.= "<select name=\"dropdown2\"><option value=\"\">Select Subject</option>";
//select values from database

global $conn;

$strSQL = "SELECT

sms_workload.CourseID,

sms_workload.SubjectID as abc,

sms_course_admin.subject,

CONCAT(subject,' ',course) as def,

sms_workload.TeacherID,

sms_course_admin.course

FROM sms_workload

INNER JOIN sms_course_admin ON sms_workload.SubjectID = sms_course_admin.subject_id

WHERE

sms_workload.TeacherID = ".$_SESSION["Root_ID_number"]."";
$rs = db_query($strSQL,$conn);

while ($data = db_fetch_array($rs))

$str.="<option value=\"".$data["abc"]."\">".$data["def"]."</option>";

$str.="</select>";

echo $str;


Now I want the selected fropdown value to be available in Before record updated event (INLINE EDIT)

I have seen the button events in the sample code, but here is no button only edit the records inline and save the same with one of the field value from the dropdown.
Thank you

Smith

Sergey Kornilov admin 10/11/2014
S
smith author 10/11/2014



Take a look at this article:

http://xlinesoft.com/phprunner/docs/add_custom_field_to_form.htm


Dear Sergey

This works if we open the add page and the dropdown is also present in the addpage
BUT this dropdown is in LIST page and i'm trying to pass the dropdown value to INLINE edit where the id value has to be passed on updating anoother table

using the dropdown value. it is passing only only blank value for the field, but all other filed value is perfect


$subject1 = $_REQUEST['dropdown2'];
global $dal;
$tblEvents = $dal->Table("attendance");
//$tblEvents->Value["Cl_ID"]= $data100["Cl_ID"];
$tblEvents->Value["date"]=$values["date"];
$tblEvents->Value["period"]=$values["period"];
$tblEvents->Value["attendance"]=$data1;
$tblEvents->Value["student_id"]=$data100["student_id"];
$tblEvents->Value["subject"]=/* $values['dropdown2']; */ $subject1;
$tblEvents->Add()


what is the command we need to put in the before record updated page to get dropdown value to be passed on inline edit

regards

smith

Sergey Kornilov admin 10/12/2014

It won't work this way. If you want something to work as a part of Inline Add or Inline Edit - this dropdown control must be a part of corresponding Add or Edit page.

S
smith author 10/12/2014



It won't work this way. If you want something to work as a part of Inline Add or Inline Edit - this dropdown control must be a part of corresponding Add or Edit page.


Thank you for the reply

Is there I can add a Button which will first take the dropdown value to php variable and make it available to the above discusses action and save all the records.

I mean a Custom Save All button which before saving takes values of custom fields (Like date, dropdown, text etc) and save to session and save all records like Save All button?

Regards

Smith

Sergey Kornilov admin 10/13/2014

You can probably make it work this way. In ClientBefore event get the value of that dropdown box, pass it to Server event. In Server event assign this parameter to some session variable. In ClientAfter event imitate the click of 'SaveAll' button.

S
smith author 10/13/2014



You can probably make it work this way. In ClientBefore event get the value of that dropdown box, pass it to Server event. In Server event assign this parameter to some session variable. In ClientAfter event imitate the click of 'SaveAll' button.


Hi Sergey,

Thank You

Smith