Help - Search - Members - Calendar
Full Version: Why Do 'preview' And 'submit' Show When Not Logged In
Movable Type Community Forum > Using Movable Type > Commenting System
Ben S
can you look at this page and let me know why "preview" and "submit" are visable when you have to be signed in to leave a comment, pressing them just creates confusion - i don't remember them being there before..

maybe i messed something up in the comment-form template?

http://www.uncharitable.net/2008/11/welcome.html

thanks
OtherNiceMan
Can you post the template please.
Ben S
Yeh, that would have useful smile.gif

i just installed 'Comment Subscribe' plugin, you can see that the "Notify when..." also apears when not logged in (btw, it works great)

I pulled up the default templates from the MT site, but Comment-Form is fairly different from what i have (i haven't really edited this template except to add in 'Subscribe' checkbox from plugin

i'm confused how it knows not to past the comment box when you're not logged in - it shows up in 'view source' - feel like i'm missing something easy?

CODE
<mt:IfCommentsAccepted>
<div class="comments-open" id="comments-open">
<h2 class="comments-open-header">Leave a comment</h2>
<div class="comments-open-content">
<div id="comment-greeting"></div>
<form method="post" action="<$mt:CGIPath$><$mt:CommentScript$>" name="comments_form" id="comments-form" onsubmit="return mtCommentOnSubmit(this)">
<input type="hidden" name="static" value="1" />
<input type="hidden" name="entry_id" value="<$mt:EntryID$>" />
<input type="hidden" name="__lang" value="<$mt:BlogLanguage$>" />
<input type="hidden" name="parent_id" value="<$mt:CommentParentID$>" id="comment-parent-id" />
<input type="hidden" name="armor" value="1" />
<input type="hidden" name="preview" value="" />
<div id="comments-open-data">
<div id="comment-form-name">
<label for="comment-author">Name</label>
<input id="comment-author" name="author" size="30" value="<mt:If name="comment_preview"><$mt:CommentAuthor encode_html="1"$></mt:If>" onfocus="mtCommentFormOnFocus()" />
</div>
<div id="comment-form-email">
<label for="comment-email">Email Address</label>
<input id="comment-email" name="email" size="30" value="<mt:If name="comment_preview"><$mt:CommentEmail encode_html="1"$></mt:If>" onfocus="mtCommentFormOnFocus()" />
</div>
<div id="comment-form-url">
<label for="comment-url">URL</label>
<input id="comment-url" name="url" size="30" value="<mt:If name="comment_preview"><$mt:CommentURL encode_html="1"$></mt:If>" onfocus="mtCommentFormOnFocus()" />
</div>
<mt:Unless name="comment_preview">
<div id="comment-form-remember-me">
<input type="checkbox" id="comment-bake-cookie" name="bakecookie" onclick="mtRememberMeOnClick(this)" value="1" accesskey="r" />
<label for="comment-bake-cookie">Remember personal info?</label>
</div>
</mt:Unless>
</div>
<div id="comment-form-reply"<mt:IfCommentParent><mt:Else> style="display:none"</mt:IfCommentParent>>
<input type="checkbox" id="comment-reply" name="comment_reply" value="<$mt:CommentParentID$>"<mt:IfCommentParent> checked="checked"</mt:IfCommentParent> onclick="mtSetCommentParentID()" />
<label for="comment-reply" id="comment-reply-label"><label for="comment-reply" id="comment-reply-label"><mt:IfCommentParent>Replying to comment from <mt:CommentParent><$mt:CommentAuthor$></mt:CommentParent></mt:IfCommentParent></label></label>
</div>
<div id="comments-open-text">
<label for="comment-text">Comments
</div>

<mt:IfAllowCommentHTML>(You may use HTML tags for style)</mt:IfAllowCommentHTML></label>
<textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()"><mt:If name="comment_preview"><$mt:CommentBody autolink="0" sanitize="0" convert_breaks="0" encode_html="1"$></mt:If></textarea>
</div>
<div id="comments-open-captcha"></div>
<div id="comment-form-subscribe">
<label for="comment-subscribe" style="width: 400px;"><input type="checkbox" id="comment-subscribe" name="subscribe" checked />
Receive email notification of further comments.</label>
</div>
<div id="comments-open-footer">
<input type="submit" accesskey="v" name="preview_button" id="comment-preview" value="Preview" onclick="this.form.preview.value='1';" />
<input type="submit" accesskey="s" name="post" id="comment-submit" value="Submit" />
<mt:If name="comment_preview">
<input type="button" name="cancel" id="comment-cancel" value="Cancel" onclick="window.location='<$mt:EntryPermalink$>'" />
</mt:If>
</div>
</form>
</div>
<script type="text/javascript">
<!--
mtAttachEvent("load", mtEntryOnLoad);
mtAttachEvent("unload", mtEntryOnUnload);
//-->
</script>
</mt:IfCommentsAccepted>
Ben S
OtherNiceMan do you have any suggestions for me? i feel like it's something very simple that i might have accidentally deleted- i knew i should have made a copy of the template before i started editing it...

thxn

b
OtherNiceMan
Just been having another look.

The template posted does not match the page source. On the page the closing form tag is just after the text area (id=comment-text), leaving comments-open-captcha, coment-form-subscribe and comments-open-footer outside of the form so they are never hidden. It would / should also play havoc if anyone tries to enter a comment as the buttons are orphaned.
Ben S
NM!!! i figured it out

you actually put me on the right track - it was just an ending div tag was out of place, so the hiding stopped half way down...

thanks!

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.