Title: Form validation
Last modified: August 20, 2016

---

# Form validation

 *  Resolved [krama757](https://wordpress.org/support/users/krama757/)
 * (@krama757)
 * [15 years ago](https://wordpress.org/support/topic/form-validation/)
 * Hi Inapan,
 * Great job making this plugin. It’s really versatile!
 * Just had 3 “quick” questions for you and the community:
    – How would you validate
   the input in a custom field? Example: I have a custom field that asks the user
   for a date in mm-dd-yy format. If they enter hi-hi-hi, how would I take them 
   back to the form submission page to make them correct this error?
 * – How is the progress on showing only the visual editor going?
    The visual editor
   is so much more powerful than the regular form…it makes no sense for me to show
   just text boxes.
 * – How would you resize the widget to only have a width of 1000 px instead of 
   the default 100%?
 * Thanks for the help.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [krama757](https://wordpress.org/support/users/krama757/)
 * (@krama757)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/form-validation/#post-2109071)
 * Hmm, figured out my own hacks to do the form validation and the widget resize.
   I also just hid the text area for the post content and now people are forced 
   to use the visual editor.
 * Solving problems is fun 🙂
 *  Plugin Author [inapan](https://wordpress.org/support/users/inapan/)
 * (@inapan)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/form-validation/#post-2109072)
 * [@krama757](https://wordpress.org/support/users/krama757/)
 * I’m sorry I haven’t been able to dive into it yet. I have been very busy lately.
 * Would you mind sharing your solutions on the forum so more of us can benefit 
   from it.
 * By the way, I agree with you: solving problems is fun (most of the time).
 * inapan
 *  Thread Starter [krama757](https://wordpress.org/support/users/krama757/)
 * (@krama757)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/form-validation/#post-2109073)
 * Np Inapan…I’m just thankful that you made such an awesome plugin.
 * I’ll give a brief idea of what I did:
    Question: **How would you resize the widget
   to only have a certain width?** Solution: In quickpost-widget.php: Place: “<div
   class=”quick_post”>” before the line “<form autocomplete=”off” method=”post” 
   name=quickpostwidget action=”” >” Then place your “</div>” after the “</form>”.
   Now in your template files, you can add custom style sheets for div.quick_post
   to choose your width, height, etc.
 * Question: **How would you validate the input in a custom field?**
    Solution: 
   Look for `for ($cfn = 1; $cfn <= $qpw_custom_fields_count; $cfn++) {` Here, if
   you know what your customfields are going to be then you can individually check
   your custom field values by using:
 *     ```
       if($_POST['customfield_1'] == 'Some incorrect input'){
       $error = 'yes';
       								?>
       								<script type="text/javascript">
       									document.getElementById(<?php echo '\'' . $customfield . '\''; ?>).style.border="solid 1px <?php echo $error_color; ?>";
       								</script> <?php
       							}
       ```
   
 * This should allow you to control and check the inputs of your various custom 
   fields assuming you know what each custom field is supposed to be.
    Question:
   How do you hide the textbox for post-content so that only the visual editor is
   used? Solution: In your widget settings, go to the style setting for post content
   and enter “visibility: hidden; position: absolute; top: 0; left: 0;” into the
   textbox.
 * That should effectively hide your post-content text box so people are forced 
   to use the visual editor.
 * Happy Coding!
 *  Thread Starter [krama757](https://wordpress.org/support/users/krama757/)
 * (@krama757)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/form-validation/#post-2109074)
 * **Question: How do you hide the textbox for post-content so that only the visual
   editor is used?**
 * This question should be bolded in the previous post >.< I wish the forum had 
   a front-end edit function 😛
 *  Plugin Author [inapan](https://wordpress.org/support/users/inapan/)
 * (@inapan)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/form-validation/#post-2109083)
 * Thanks for sharing!
 * inapan
 *  [Sorcol](https://wordpress.org/support/users/sorcol/)
 * (@sorcol)
 * [14 years ago](https://wordpress.org/support/topic/form-validation/#post-2109204)
 * [@krama757](https://wordpress.org/support/users/krama757/) Thanks for that…very
   useful tip for hiding the textbox.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Form validation’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/quick-post-widget.svg)
 * [Quick Post Widget](https://wordpress.org/plugins/quick-post-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/quick-post-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/quick-post-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/quick-post-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/quick-post-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/quick-post-widget/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [Sorcol](https://wordpress.org/support/users/sorcol/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/form-validation/#post-2109204)
 * Status: resolved