<div class="glm-add-event-form-item" id="glm-descr">
<div class="glm-add-event-form-label"><label{if $event.fieldRequired.descr} style="color: red;"{/if}>Description:</label></div>
<div class="glm-add-event-form-data{if $event.fieldFail.descr} glm-form-bad-input" data-tabid="glm-event-descr{/if}">
- {php}
- wp_editor('{$event.fieldData.descr|escape:quotes}', 'glm_descr', array(
- 'media_buttons' => false,
- 'quicktags' => array( 'buttons' => 'strong,em,ul,ol,li,close'),
- 'tinymce' => false,
- 'textarea_name' => 'descr',
- 'editor_height' => 200, // Height in px, overrides editor_rows
- ));
- {/php}
+ <textarea id="glm-event-front-descr" name="descr" style="height:150px;width:100%;" required></textarea>
{if $event.fieldFail.descr}<p>{$event.fieldFail.descr}</p>{/if}
</div>
</div>
- <div class="glm-add-event-form-item">
- <div class="glm-add-event-form-label{if $event.fieldRequired.image} glm-required{/if}"><label>Image:</label></div>
- <div class="glm-add-event-form-data{if $event.fieldFail.image} glm-form-bad-input{/if}">
- <table class="glm-admin-image-edit-table">
- {if $event.fieldData.image}
- <div>
- <div>
- <div class="glm-galleryImage" data-id="image">
- <img src="{$glmPluginMediaUrl}/images/small/{$event.fieldData.image}">
- </div>
- </div>
- <div>
- <input type="checkbox" name="image_delete"> Delete Image<br>
- {$event.fieldData.image}<br>
- </div>
- </div>
- {/if}
- <div><div colspan="2"><b>New image:</b> <input type="file" name="image_new"></div></div>
- </table>
- </div>
- </div>
{if $memberOnly}
<div class="glm-add-event-form-item">
<div class="glm-add-event-form-label"></div>
<input name="admin_org" maxlength="100" type="text" class="glm-required" pattern="{literal}.*\S+.*{/literal}" title="This field is required" required>
</div>
</div>
- <!-- <div class="glm-add-event-form-item"> -->
- <!-- <div class="glm-add-event-form-label"> -->
- <!-- <label>Event File</label> -->
- <!-- </div> -->
- <!-- <div class="glm-add-event-form-data"> -->
- <!-- <input name="file_rmv" type="file"> -->
- <!-- </div> -->
- <!-- </div> -->
- <!-- <div class="glm-add-event-form-item"> -->
- <!-- <div class="glm-add-event-form-label"> -->
- <!-- <label>File Description</label> -->
- <!-- </div> -->
- <!-- <div class="glm-add-event-form-data"> -->
- <!-- <input name="fileDescription" maxlength="100" type="text"> -->
- <!-- </div> -->
- <!-- </div> -->
</div>
<input class="button radius" id="newEvent" name='newEvent' type="submit" value="Add Event">
</form>
// Double check the form for valid entries before allowing it to be submitted.
$('#frontForm').submit(function(){
- var introText = $('textarea[name=intro]').val();
- var descrText = get_tinymce_content();
- if ( introText.trim() === '' ) {
- alert( 'Intro Text is empty' );
- location.href = '#glm-intro';
- return false;
- }
- if ( descrText.trim() === '' ) {
- alert( 'Description is empty' );
- location.href = '#glm-descr';
+ var descr = $('#glm-event-front-descr').val();
+ if ( descr.indexOf( 'href' ) != -1 ) {
+ alert( 'Please use only plain text in the Description!' );
return false;
}
return true;