【问题标题】:Copy the text value of a referenced categoryfield into another textfield将参考类别字段的文本值复制到另一个文本字段中
【发布时间】:2017-10-03 19:00:47
【问题描述】:

我使用 Advanced Webform for Podio 的源代码制作了一个网络表单。我有一个由引用的类别字段组成的列表。 When an item from the list is selected and the form is submitted, I want the text value from the referenced category field to be copied into the an other textfield. 提交后和将数据保存到 Podio 之前,我可以从 后数组。

if ($_POST){
// all the values are stored in $_POST array

然后我像这样从类别字段中获取值:

 $value_from_selected_list = $_POST['uu center'];

在此之后,我将值复制到新的文本字段

$_POST['organisation'] = $value_from_selected_list; 
        // set all the values in the Podio app  
       $podioform->set_values($_POST,$_FILES);
       $podioform->save();
       $podioform = 'Kære '.$_POST['navn'].' Tak for din tilmelding';

}

我的问题是 $_POST['organisation'] 只返回一个 id 而不是文本值。

【问题讨论】:

    标签: php podio


    【解决方案1】:

    我自己找到了解决方案。 $_POST['uu-center'] 保存引用的应用程序的item_id。所以我找到了引用字段的field_id 并使用了get_field_value 方法,该方法将item_idfield_id 作为参数

    $item_id = $_POST['uu-center'];
    $field_id = 154492804;
    $uucenter = PodioItem::get_field_value($item_id,$field_id); 
    

    该方法返回一个包含所选字段值的数组。然后我得到了文本字符串。

    $value_to_be_copy = $uucenter[0][value];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多