User Submitted Posts
[resolved] show error message or success message to user (5 posts)

  1. WordPress.Net.In
    Posted 3 years ago #


    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.


  2. Jeff Starr
    Plugin Author

    Posted 3 years ago #

    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 } ?>
  3. WordPress.Net.In
    Posted 3 years ago #

    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() {

    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'); ?>">


  4. Jeff Starr
    Plugin Author

    Posted 3 years ago #

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

  5. MarketRaisen2
    Posted 2 years ago #

    Any idea how to remove these completely?

    Or better still keep them without hiding the form?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Submitted Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic