2009-09-04 14 views
0

我正嘗試使用Facebook將表單數據發佈到我的應用程序。我的表單與對話框集成在一起,我使用form.submit()來提交表單。請參閱我的代碼。後端數據不會出現在後端(例如,貨運 - 無線電,city-id,train-id),但是fb_sig *數據可以。有誰知道是否有任何關於在Facebook上發佈表單數據的警告?謝謝!Facebook表單發佈數據在後臺不存在

注意:我已經嘗試使用我的服務器域和我的fb回調url的窗體操作。兩者都不起作用。

<div id="action_prompt"> 
Loading cargo... 
</div> 
<fb:js_string var="fbjs_load_cargo_select"> 
    <div id="load_cargo_select"> 
    <form id="load_cargo_select_form" action="http://railsacrosseurope.com/turn/load_cargo_select" method="POST"> 
     <p>Your train has stopped in the city of Arhus.</p> 
     <p>Arhus produces the following goods:</p> 
     <ul> 
        <li>Dairy</li> 
       </ul> 
     <p>Your train is hauling the following goods:</p> 
     <ul> 
        <li>Timber</li> 
       </ul> 
     <p>What would you like to do?</p> 
     <input type="radio" id="load_cargo_radio" value="1">Load new goods</input>&nbsp;&nbsp; 
     <input type="radio" id="load_cargo_radio" value="2">Discard existing goods</input> 
     <input type="hidden" id="city_id" value="3" /> 
     <input type="hidden" id="train_id" value="15" /> 
     <input type="submit" id="submit" value="Submit" /> 
    </form> 
    </div> 
</fb:js_string> 

. 
. 
. 
<script type="text/javascript"> 
    var dialog = new Dialog().showChoice('Load Cargo', fbjs_load_cargo_select, 'Okay', 'Pass'); 
    dialog.onconfirm = function() { 
    // Submit the form if it exists, then hide the dialog. 
    frm = document.getElementById('load_cargo_select_form'); 
    if (frm) { frm.submit(); } 
    dialog.hide(); 
    }; 
    dialog.oncancel = function() { 
    form = document.getElementById('redirect_form'); 
    form.setAction('http://apps.facebook.com/rails_across_europe/turn/move_trains_auto/'); 
    form.submit(); 
    } 
</script> 
[/code] 
+0

難道你不是指load_cargo_radio?你在文本中有破折號,但在代碼中強調。 – seth 2009-09-04 16:30:28

+0

我試圖在文本中加下劃線,但是這會導致斜體效果,所以我使用了破折號。但他們是一樣的。 – 2009-09-04 16:57:13

回答

0

問題不在於Facebook。問題是我遺漏了我的輸入元素的「名稱」屬性。