Support » Plugin: User Submitted Posts » show error message or success message to user

  • Resolved WordPress.Net.In

    (@wordpressnetin)


    Hello

    I am using this plugin on a page where a lot of content and user has to scroll down to fill the form. But when user fill the form and either error message or success message is displayed the browser doesn’t focus user to that place, which is actually just above the form, and user can’t make sure if his submission is success or has any error.

    I want to show the message to user, i try get focus using javascript but the page is reload and i am not able to focus on message.

    Is there any help.

    http://wordpress.org/extend/plugins/user-submitted-posts/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Hi, the plugin passes a GET parameter on success or error that may be used to customize your theme however you like, for example:

    <?php if($_GET['submission-error'] == '1') { ?>
    	<div id="usp-error-message"><?php echo $usp_options['error-message']; ?></div>
    <?php } ?>
    <?php if($_GET['success'] == '1') { ?>
    	<div id="usp-success-message"><?php echo $usp_options['success-message']; ?></div>
    <?php } ?>

    Thanks for quick reply. I try but not get success

    I use this javascript code, please check if I am wrong anywhere

    <script language="JavaScript">
      function setFocus() {
      document.getElementById('text').focus();
    
      }
    
    </script>

    And this code on submit button

    <input name=”user-submitted-post” type=”submit” onClick=”setFocus()” value=”<?php _e(‘Submit Post’); ?>”>

    And the last code for focus on text box

    <input name=”user-submitted-title” id=”text” onFocus=”setFocus()” type=”text” value=”” placeholder=”<?php _e(‘Post Title’); ?>”>

    Thanks

    Plugin Author Jeff Starr

    (@specialk)

    Not sure about the JavaScript, but the PHP in my previous reply works like a charm.

    Any idea how to remove these completely?

    Or better still keep them without hiding the form?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘show error message or success message to user’ is closed to new replies.