Can you spot any issues with my code below. I can’t get a very simple Safecracker form to submit.
* Running EE 2.3.1 and Safecracker 2.1
* Working locally on PHP Version 5.2.13
When I click Submit, the screen just refreshes and shows the form. No Errors are shown.
* I double checked the channel name and field names
* I tried turning on inline errors but that didn’t help
* I tried turning safecrack_head, json and jquery parameters to yes
* I tried removing the two custom fields from the form
* I am loading my own jquery script (which has been removed from this post - but I did verify with Firebug that it’s loading)
I must be missing something so could you take a look and let me know what I should do to debug this.
Below is my complete template…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[removed][removed]
</head>
<body>
{if segment_2 == "new"}
Question # {segment_3} has been submitted.
{/if}
{if segment_2 == ""}
Member Group = {logged_in_group_id}
{exp:safecracker channel="questions" return="test/new/ENTRY_ID" safecracker_head="no" json="no" include_jquery="no" datepicker="no"}
<input type="hidden" name="title" id="title" value="Question Test"/>
<input type="hidden" name="url_title" id="url_title" value="question-test"/>
<input type="hidden" name="question_asker" id="question_asker" value="{logged_in_screen_name}" />
<textarea name="question_text" id="question_text"></textarea>
<button name="submit" type="submit">Submit</button>
{/exp:safecracker}
{/if}
</body>
</html>And below is the output of the above template…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[removed][removed]
</head>
<body>
Member Group = 1
<form id="publishForm" method="post" action="http://www.example.local/test" enctype="multipart/form-data" >
<div class='hiddenFields'>
<input type="hidden" name="ACT" value="82" />
<input type="hidden" name="RET" value="http://www.example.local/test" />
<input type="hidden" name="URI" value="test" />
<input type="hidden" name="XID" value="c0a4ef43804d7343d4b47b6a70ddbcff40492389" />
<input type="hidden" name="return_url" value="test/new/ENTRY_ID" />
<input type="hidden" name="author_id" value="1" />
<input type="hidden" name="channel_id" value="7" />
<input type="hidden" name="entry_id" value="0" />
<input type="hidden" name="site_id" value="1" />
<input type="hidden" name="return" value="test/new/ENTRY_ID" />
<input type="hidden" name="allow_comments" value="n" />
</div>
<input type="hidden" name="title" id="title" value="Question-1-1319547871"/>
<input type="hidden" name="url_title" id="url_title" value="question-1-1319547871"/>
<input type="hidden" name="question_asker" id="question_asker" value="Cull Superadmin" />
<textarea name="question_text" id="question_text"></textarea>
<button name="submit" type="submit">Submit</button>
</form>
</body>
</html>