Question

I i'm using meteor and i added jquery to my project and i added previewForm plugin files to my client/lib directory(.js file and .css file). Here is my form

<form  id="myform">
   <div class="form-group">
      <label for="Headline" class="col-sm-2 control-label">Headline</label>
        <div class="col-sm-10">
          <input type="Headline" class="form-control" id="Headline" name ="jobHeadline" placeholder="Awesome coder wanted for an awesome company">
          <p>A single-line summary. This goes to the front page and across the network</p>
         </div>
   </div>


 <button id="preview" type="button" class="btn btn-primary" >Preview</button>
 <button id="submit" type="button" class="btn btn-primary formsubmit">Post Job</button>

</form>

and onClick event

'click .formpreview': function(event){
                        console.log("before plugin");
                         $('#myform').previewForm();

            }

It is not working,not showing any preview as shown in demo

It is not showing any error messages too and the previewForm function is calling(i tested it by writing some text to console).

What's wrong with my code and is there any alternatives for form preview.Is there any atmosphere packages for this.

Thanks

Was it helpful?

Solution

It's my mistake In my form i added this

 <button id="preview" type="button" class="btn btn-primary" >Preview</button>

instead of this

<input id="preview" type="submit" value="preview" class="btn btn-primary formpreview" >
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top