Support » Plugins » [Plugin: Custom Field Template] Required fields

  • Love this plugin! I apologize in advance if these questions have already been asked… I’ve looked all over but couldn’t find anything.

    Is it possible to set a field (or multiple fields) as required? Ie. a user must fill in a particular field or fields before successfully publishing their post.

    It would also be great if the fields were automatically labeled for accessibility in the backend (ie. <label for=”somefield”>Some Field:</label><input type=”text” id=”somefield”>).

    Again, if this has already been addressed, please point me in the right direction. Thanks for a great plugin!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am looking for some good ways to validate the field values…. This is a temporal way to set a field as required by use of JavaScript.

    Template Instruction

    <script type="text/javascript">
    jQuery('#save-post').click(function() {
    	if(!jQuery('.test').val()) { alert('Empty!'); return false; }
    jQuery('#publish').click(function() {
    	if(!jQuery('.test').val()) { alert('Empty!'); return false; }

    Template Content

    type = text
    size = 35
    class = test

    Hi Hiroaki,

    This is great plug-in, however, I ran into some issues. I followed the same instructions, but when I leave the field empty, click on publish, it says empty. After I gave the value and click on publish, it still says empty. Please advice.

    This is my template content:

    type = textarea
    rows = 4
    cols = 40
    tinyMCE = true
    mediaButton = true
    class = Attach

    [Post As]
    type = checkbox
    value = Anonymous
    valueLabel = Anonymous
    output = true

    This is template instruction:
    <script type=”text/javascript”>
    jQuery(‘#save-post’).click(function() {
    if(!jQuery(‘.Attach’).val()) { alert(‘Empty!’); return false; }
    jQuery(‘#publish’).click(function() {
    if(!jQuery(‘.Attach’).val()) { alert(‘Empty!’); return false; }

    Thank you very much!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Custom Field Template] Required fields’ is closed to new replies.