68 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Netherlands
  • Sold between 1 000 and 5 000 dollars
botervet says

Hi,

wordpress issue!!!

Im building this passord protected page. No i want to be able to comment this page. I want to use a custom comment form for this with a textarea field only. cuz i don’t need to know who put the comment there. cuz there is only one person that has acces to this page.

for the other pages i want to use the normal comment.php. so using this isn’t an option!

this is what i’ve tried!

<form method="post" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" id="commentform"> <textarea name="comment" class="cform" id="comment" onfocus="clearText(this)" rows="10" cols="48" tabindex="1" onblur="clearText(this)"></textarea> <input name="submit" id="submit" value="Verstuur Reactie" type="submit" tabindex="2" /> <input name="comment_post_ID" value="<?php echo $id; ?>" type="hidden" /> <?php do_action('comment_form', $post?>ID); ?> </form>

when i use this… no comment is posted and i will go to… http://www.myurl.com/wp-comments-post.php and get a white screen… without getting redirected back to the password protected page.

How can i get this to work?

thanx :)

730 posts
  • Elite Author
  • Attended a Community Meetup
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Most Wanted Bounty Winner
+2 more
mordauk says

Try using the default Comment Form (though you could remove the name and email input fields), then go into Settings > Discussion and uncheck “Comment author must fill out name and e-mail ”.

409 posts
  • Exclusive Author
  • Has been a member for 3-4 years
  • India
Dhruv says

Don’t forget to Validate the default comment form. (don’t leave it for WordPress to validate)

68 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Netherlands
  • Sold between 1 000 and 5 000 dollars
botervet says

Try using the default Comment Form (though you could remove the name and email input fields), then go into Settings > Discussion and uncheck “Comment author must fill out name and e-mail ”.

Thanx for the reply… but the thing is… For other pages a email and name is required! Or is there a work around?

730 posts
  • Elite Author
  • Attended a Community Meetup
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Most Wanted Bounty Winner
+2 more
mordauk says

You could make name and email non required, and then add some custom validation code to your form inputs when not on the password protected page.

68 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 7-8 years
  • Netherlands
  • Sold between 1 000 and 5 000 dollars
botervet says

You could make name and email non required, and then add some custom validation code to your form inputs when not on the password protected page.

can u by any chance give me a startup how to do this? :)

730 posts
  • Elite Author
  • Attended a Community Meetup
  • Has been a member for 4-5 years
  • Sold between 100 000 and 250 000 dollars
  • Bought between 50 and 99 items
  • Exclusive Author
  • Most Wanted Bounty Winner
+2 more
mordauk says

This isn’t a great solution because it wouldn’t check whether the email is valid, but you could do a really simply solution where you just check whether the name and email fields are empty.

Use this as a reference: http://stackoverflow.com/questions/1342676/to-disable-a-send-button-if-fields-empty-by-jquery

by
by
by
by
by
by