WordPress.org

Ready to get started?Download WordPress

Forums

User Submitted Posts
[resolved] The form fields seem to remember entered values even after reloading page (5 posts)

  1. droopyman
    Member
    Posted 6 months ago #

    Hey guys,

    I have been using this plugin for a long time, but after the latest update of the plugin it is giving me problems.

    The form fields seem to remember the entered values permanently, even after reloading the page. Only clearing the cookies and cache gets rid of the form values. Is there way to tell the form not to remember the enter values?

    Please help.

    Note: I have enabled Javascript option in my "User submitted post" options.

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

  2. droopyman
    Member
    Posted 6 months ago #

    I found this code inside user-submitted-posts/resources/usp.php. This code is making the form values to be remembered permanently even after reloading the form several times. Only clearing the borwser cache and cookies will make the form forget the values.

    What should I do to make the form form forget the values once the page is reloaded.

    // remember input values
    	function remember(selector){
    		$(selector).each(function(){
    			var name = $(this).attr('name');
    			if($.cookie(name)){ $(this).val($.cookie(name)); }
    			$(this).change(function(){$.cookie(name, $(this).val(), { path: '/', expires: 365 });});
    		});
    	}
    	remember('[name=user-submitted-name]');
    	remember('[name=user-submitted-url]');
    	remember('[name=user-submitted-title]');
    	remember('[name=user-submitted-tags]');
    	remember('[name=user-submitted-captcha]');
    	remember('[name=user-submitted-category]');
    	remember('[name=user-submitted-content]');
  3. Jeff Starr
    Member
    Plugin Author

    Posted 6 months ago #

    Disabling the JavaScript file is one way to go about it, then you can add any of the other snippets manually via your theme or whatever.

  4. droopyman
    Member
    Posted 6 months ago #

    Hi Jeff,

    I want to thank you so much for making this plugin. This plugin is very important and valuable to me.

    I fixed the problem by commenting out the "// remember input values" code I mentioned in my previous reply. The code can be found inside user-submitted-posts/resources/usp.php Now the form does not remember the entered values after reloading the page.

    But a bug I wish to report here is. If I disable javascript in the USP options, then there is a form validation bug that seems to arise. The "Post Content" field validation seems to have disappeared after the latest update.

    For example: The user leaves the "Post Content" field blank clicks submit, the form successfully submits. This results in a blog post that has a "Post title" but does not have "Post content".

  5. Jeff Starr
    Member
    Plugin Author

    Posted 6 months ago #

    Glad to hear you got it, and thanks for the feedback -- will definitely look into it for the next update.

Reply

You must log in to post.

About this Plugin

About this Topic