2014-06-18 3 views
0

중력 양식 용 add_filter를 적용 할 때 도움이 필요합니다. 몇 가지 조사를 해본 결과이 링크 http://www.gravityhelp.com/documentation/page/Gform_pre_render은 맞춤 필터를 적용하는 방법에 대한 대략적인 예입니다. 불행히도 운이 없어서 일하지 못했습니다. 오류가 없습니다. 사용자가 하나를 선택할 때 라디오 버튼의 상단이나 하단에 에코 텍스트를 표시하려고합니다.중력 양식 add_filter

<ul class="gfield_radio" id="input_7_16"> 
<li class="gchoice_16_0"> 
<input name="input_16" type="radio" value="Plan 180" id="choice_16_0" tabindex="1"> 
<label for="choice_16_0" id="label_16_0">Op1</label> 
</li> 

<li class="gchoice_16_1"> 
<input name="input_16" type="radio" value="Plan 420" id="choice_16_1" tabindex="2"> 
<label for="choice_16_1" id="label_16_1">Op2</label> 
</li> 

<li class="gchoice_16_2"> 
<input name="input_16" type="radio" value="Plan 560" id="choice_16_2" tabindex="3"> 
<label for="choice_16_2" id="label_16_2">Op3</label>< 
/li> 
</ul> 

중력 폼 필터

add_filter('gform_pre_render_6', 'populate_text'); 
function populate_text($form){ 

if ($field["id"] == choice_16_0) { 
    echo '<br/>Your start date is Saturday ' , getStartSat(); 
} 
else if ($field["id"] == choice_16_1) { 
    echo '<br/>Your start date is Monday ' , getStartMon(); 
} 
else if ($field["id"] == choice_16_2) { 
    echo '<br/>Your start date is Saturday ' , getStartSat(), 'or <br/> Monday ' , getStartMon(); 
} 

return $form; 
} 

답변

-1

실제로 양식을 제출하는 추가? 사전 렌더링은 양식이로드되기 전에 사전 렌더링을 얻는 데이터이며 '사전 렌더링'정보를로드하는 것입니다. 여러 양식 및/또는 사용자 정의 DB 쿼리로 정말 잘 작동합니다.

조건부 로직 & 텍스트 필드를 혼합하여 제출하지 않을 경우이를 처리합니다. Gravity Forms에서 텍스트를 에코하려면 수십 가지 방법이 있습니다.