TYPO3 sysext表单:获取所选单选按钮的值

时间:2016-06-29 07:27:52

标签: forms typo3 typo3-7.6.x

我创建了一个带有三个单选按钮和一个提交按钮的简单表单。

enter image description here

单选按钮的整数为值

Value of Radio Button #1:   40
Value of Radio Button #2:   41
Value of Radio Button #3:   42

如果用户选择单选按钮#1并按下提交按钮,则应将其重定向到ID为40的页面。

如何找出选择哪个单选按钮并获取其值?我试过这个GP:assistent:group1

整个表单配置:

title = test
enctype = application/x-www-form-urlencoded
method = post
prefix = assistent
confirmation = 
postProcessor {
    1 = redirect
    1 {
        destination = GP:assistent:group1
    }
}
10 = RADIOGROUP
10 {
    class = fieldset-subgroup
    legend {
        value = Nächste Schritte
    }
    name = group1
    10 = RADIO
    10 {
        checked = checked
        type = radio
        value = 40
        label {
            value = Ich habe ein Problem mit X
        }
    }
    20 = RADIO
    20 {
        type = radio
        value = 41
        label {
            value = Ich habe ein Problem mit Y
        }
    }
    30 = RADIO
    30 {
        type = radio
        value = 42
        label {
            value = Ich habe ein Problem mit Z
        }
    }
}
20 = SUBMIT
20 {
    type = submit
    name = 6
    value = Weiter
}

1 个答案:

答案 0 :(得分:-1)

一种解决方案是添加表格并grep GP参数。 “LOAD_REGISTER”喜欢

page.1=TEXT
page.1.value (
<form method="get" action="">
<ul>
<li><input type="radio" name="myid" value="20" /></li>
<li><input type="radio" name="myid" value="30" /></li>
</ul>
<input type="submit" value="Dummy text">
</form>
)

[globalVar = GP:myid >0]
page.jsInline {
     1234 = TEXT
     #1234.dataWrap = alert("redirect to:'Location: index.php?id={GP:nameradio}'");
     1234.value = window.location.assign("index.php?id={GP:myid}")
     1234.insertData=1
}
#or with config.additionalHeaders
[global]
保持简单。

问候 皮特