我在这样的活动表格中有一个下拉列表
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<NSString *,id> *)options
{
return [[FBSDKApplicationDelegate sharedInstance] application:app
openURL:url
sourceApplication:options//Only string
annotation:options];//id
}
我希望在下面链接的参数中发送其选定的值。
像这样:
<?= $form->field($model, 'emailTemplateId')->dropDownList($emailTemplateIds,
['prompt'=>'-Choose an Email Template-']
?>
它是如何完成的?
答案 0 :(得分:1)
使用jquery执行此操作
<?= $form->field($model, 'emailTemplateId')->dropDownList($emailTemplateIds,
['prompt'=>'-Choose an Email Template-', 'id'=>'select']
?>
<?= Html::a('Send', ['invoice/send-invoice', 'emailTemplateId' => 0], ['id' => 'send'] ) ?>
jQuery Part
$("#select").change(function(){
var text = $("#send").attr("href");
href = text.replace(/(emailTemplateId=)[^\&]+/, '$1' + $(this).val());
$("#send").attr("href", href);
})