laravel | ajax, if form incomplete send email - html

Hello fellow developers,
I am trying to solve a problem I am having and can't seem to find the correct answer a possible link or explanation will be very helpful.
I want to add an ajax function on the email field once the email is entered the name, surname and email should be saved to the database without the submit button being pressed. So that a (complete your form) email can be send 2 hours later.
I am really new to ajax and already using parsley for front end verification
Would anybody be able to assist?
Regards
{{ csrf_field() }}
<div class="form-group">
<label for="`name" class="name">First Name:</label>
<input type="text" name="name" id="name" class="form-control" required=" "
data-parsley-minlength="6" data-parsley-trigger="blur">
</div>
<div class="form-group">
<label for="surname" class="surname">Surname:</label>
<input type="text" name="surname" id="surname" class="form-control"
required=" " data-parsley-minlength="6" data-parsley-trigger="blur">
</div>
<div class="form-group">
<label for="email" class="email">Email Address:</label>
<input type="text" name="email" id="email" class="form-control" required=" "
data-parsley-type="email" data-parsley-trigger="blur">
</div>
<div class="form-group">
<label for="`size" class="size">Size of company:</label>
<input type="text" name="size" id="size" class="form-control" required=" "
data-parsley-type="integer" data-parsley-trigger="blur">
</div>
<div class="form-group">
<label for="`income" class="income">Income:</label>
<input type="text" name="income" id="income" class="form-control" required="
" data-parsley-type="integer" data-parsley-trigger="blur">
</div>
<div class="form-group" style="padding-bottom: 10px">
<label>Position in Company:</label>
<select name="position" id="position" class="form-control" value=" {{
old('position') }}" required=" " data-parsley-trigger="blur">
#foreach(App\Http\Utilities\Position::all() as $position)
<option value="{{ $position }}">{{ $position }}</option>
#endforeach
</select>
</div>
<div class="form-group">
<textarea name="message" id="message" class="form-control" rows="4" data-
parsley-maxlength="1000" data-parsley-trigger="blur">Enter text here...
</textarea>
</div>
<div class="form-group">
<label for="path" class="path">Accept Terms and Conditions
<input type="checkbox" name="path" class="form-control" required=" " data-
parsley-trigger="blur"></label>
</div>
<div class="form-group">
<input type="file" class="form-control" name="cv" id="cv" data-parsley-
trigger="blur">
</div>
<button type="submit"class="btn btn-primary">Submit details</button>

Related

When i clicking the text area on my <form> tag there's a white square appearing on the top of the <form> tag

you can check the link so you can check what I'm trying to say.
and here is the code that I wrote. for that form. I did not style the .
https://kevkevkevin.github.io/contactform_/
<div id="form_">
<h2>Contact Us</h2>
<form action="#">
<div class="form-group">
<label for="name">Name:</label>
<input type="name" class="form-control" id="name" placeholder="Your Name" name="name">
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
</div>
<div class="form-group">
<label for="subj"><span>Subject</span>
<select name="sbj" class="form-control" id="slct_bg">
<option class="special" value="Appointment">Appointment</option>
<option class="special" value="Interview">Interview</option>
<option class="special" value="Regarding a post">Regarding a post</option>
</select>
</label>
</div>
<div class="form-group">
<label for="email">Message:</label>
<textarea class="form-control" rows="5" id="message" placeholder="Leave your message here*" required></textarea>
</div>
<a href=""><div class="button_">
Submit
</div> </a>
</form>
</div>

required property of input field not working and input field color does not changed

<div class="container">
<h1>SignUp Form</h1>
<form>
<div class="form-group" >
<label for="name">Name</label>
<input type="text" class="form-control" [ngClass]="{'red-border':user.name.errors}" [(ngModel)]="user.name" [ngModelOptions]="{standalone: true}" id="name" required >
</div>
<div class="form-group">
<label for="pass">Password</label>
<input type="password" class="form-control" id="pass" [(ngModel)]="user.pass" [ngModelOptions]="{standalone: true}">
</div>
<div class="form-group">
<label for="cpass">Confirm Password</label>
<input type="password" class="form-control" id="cpass "required [(ngModel)]="user.cpass" [ngModelOptions]="{standalone: true}">
</div>
<div class="form-group">
<label for="dob">DOB</label>
<input type="date" class="form-control" id="dob" required [(ngModel)]="user.dob"[ngModelOptions]="{standalone: true}">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" id="email" required [(ngModel)]="user.email" [ngModelOptions]="{standalone: true}">
</div>
<div class="form-group">
<label for="contact">Contact</label>
<input type="text" class="form-control" id="contact" required [(ngModel)]="user.contact" [ngModelOptions]="{standalone: true}">
</div>
<button type="button" (click)="validateUser(user)" class="btn btn-success" >Submit</button>
</form>
</div>
I am new to angular 2, i had tried required property in input tag,but its not working. Also i want to change the color when input in wrong. I tried it but i don,t get it how to do it. Here is the code.
give name to your input field like name="name" and then try this user.name.errors.required instead of user.name.errors

Why is my html form not sending to email or won't submit when I put code needed?

Here is the code to my form, if anyone has a way of fixing this that would be awesome.
<form id="rendered-form">
<div class="fb-text form-group field-name">
<label for="name" class="fb-text-label">Name <span class="required">*</span> </label>
<input type="text" required="" class="form-control name" name="name" id="name" aria-required="true"></div>
<div class="fb-email form-group field-email">
<label for="email" class="fb-email-label">Email <span class="required">*</span> </label>
<input type="email" required="" class="form-control email" name="email" id="email" aria-required="true"></div>
<div class="fb-text form-group field-phone">
<label for="phone" class="fb-text-label">Phone Number </label>
<input type="text" class="form-control phone" name="phone" id="phone"></div><div class="fb-undefined form-group field-message">
<label for="message" class="fb-textarea-label">Message <span class="required">*</span> </label>
<textarea type="textarea" required="" rows="5" class="form-control message" name="message" id="message" aria-required="true"></textarea></div>
<div class="fb-submit form-group field-button-1480832953294"><button type="submit" class="button-input btn btn-warning" name="button-1480832953294" style="warning" id="button-1480832953294">CONTACT US</button></div></form>
</div>
Here is the new code, I have just updated it and it still doesnt work.
<div data-form-alert="true">
<div hidden="" data-form-alert-success="true" class="alert alert-form alert-success text-xs-center">We will contact you as soon as possible!</div>
</div>
<form id="rendered-form" action="mailto:zach#ztmartin.net" method="post">
<div class="fb-text form-group field-name">
<label for="name" class="fb-text-label">Name <span class="required">*</span> </label>
<input type="text" required="" class="form-control name" name="name" id="name" aria-required="true"></div>
<div class="fb-email form-group field-email">
<label for="email" class="fb-email-label">Email <span class="required">*</span> </label>
<input type="email" required="" class="form-control email" name="email" id="email" aria-required="true"></div>
<div class="fb-text form-group field-phone">
<label for="phone" class="fb-text-label">Phone Number </label>
<input type="text" class="form-control phone" name="phone" id="phone"></div>
<div class="fb-undefined form-group field-message">
<label for="message" class="fb-textarea-label">Message <span class="required">*</span> </label>
<textarea type="textarea" required="" rows="5" class="form-control message" name="message" id="message" aria-required="true"></textarea>
</div>
<div class="fb-submit form-group field-button-1480832953294">
<button type="submit" class="btn btn-primary">CONTACT US</button>
</div>
</form>
You should send your form through an action
<form action="example.php" method="post">
It doesn't have to be PHP, but it is an example for how to make an action attribute.
For posting data, you should put method="post" in your form tag, as in
<form method="post">
...
</form>
The default method is get.
The action attribute is not needed if your post url is the same as the current url. in fact, by not putting anything in your form tag, and assuming your page is found at http://myhost.com/mypage, you're actually using the equivalent of this:
<form action="http://myhost.com/mypage" method="get">
...
</form>

How can i create message box using bootstrap?

I am using Bootstrap 3. I am just unable to create message box which should have 4 rows inside. can anyone please help me? My code is below:
<div class="row">
<div class="col-lg-12">
<form action="" method="POST" enctype="multipart/form-data" id="form_id">
<div class="form-group">
<h5><label for="inputName">Name</label></h5>
<input type="text" name="career[name]" class="form-control" tabindex="1" placeholder="Enter your name" pattern="[a-zA-Z. ]{1,50}" required>
</div>
<div class="form-group">
<h5><label for="inputEmail">Email</label></h5>
<input type="email" name="career[email]" class="form-control" tabindex="2" placeholder="Enter your email address" required>
</div>
<div class="form-group">
<h5><label for="inputMobile">Mobile</label></h5>
<input type="tel" name="career[mobile]" class="form-control" tabindex="3" placeholder="Enter your mobile number" pattern="[0-9]{10}" maxlength="10" required>
</div>
<div class="form-group">
<h5><label for="inputMessage">Message</label></h5>
<input type="text" name="career[message]" class="form-control" tabindex="4" placeholder="Write your details" required>
</div>
<button type="submit" name="submit" class="btn btn-primary btn-block" tabindex="5">Submit</button>
</form>
</div>
</div>
I want my message box something like this.
Your problem is you are not using textarea! Replace the below code:
<input type="text" name="career[message]" class="form-control" tabindex="4"
placeholder="Write your details" required>
With:
<textarea name="career[message]" class="form-control" tabindex="4"
placeholder="Write your details" required></textarea>

Mailchimp advance form integration

Hello I have signup contact form that has a checkbox for news and updates of the site.
I'll be integrating the mailchimp for this
Any help?
Here is my HTML code
<form role="form" id="feedbackForm">
<div class="col-lg-6">
<div class="form-group">
<label class="control-label" for="textinput">First Name<span class="required">*</span></label>
<input type="text" class="form-control required" id="first_name" name="first_name" placeholder="Enter your First Name"/>
<span class="help-block" style="display: none;">Please enter your first name.</span>
</div>
<div class="form-group">
<label class="control-label" for="textinput">Last Name<span class="required">*</span></label>
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Enter your Last Name"/>
<span class="help-block" style="display: none;">Please enter your last name.</span>
</div>
<div class="form-group">
<label class="control-label" for="textinput">Email Address<span class="required">*</span></label>
<input type="email" class="form-control" id="email" name="email" placeholder="Enter your email address"/>
<span class="help-block" style="display: none;">Please enter a valid e-mail address.</span>
</div>
<div class="form-group">
<label class="control-label" for="textinput">Company Name</label>
<input type="email" class="form-control" id="company_name" name="company_name" placeholder="Enter your company name"/>
</div>
<div class="form-group">
<label class="control-label" for="textinput">Message<span class="required">*</span></label>
<textarea rows="10" cols="100" class="form-control" id="message" name="message" placeholder="Enter your message"></textarea>
<span class="help-block" style="display: none;">Please enter a message.</span>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<label for="selectbasic">How did you hear about us?</label>
<select id="selectbasic" name="selectbasic" class="form-control">
<option>Select</option>
<option value="Search Engine">Search engine</option>
<option value="Microsoft DPE">Microsoft DPE</option>
<option value="Microsoft Event">Microsoft event</option>
<option value="Social Media">Social media</option>
<option value="Word of Mouth">Word of mouth</option>
<option value="Other">Other</option>
</select>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="inlineCheckbox1" value="option1"> Please keep me informed of kinectAPI product updates and news
</label>
</div>
<img id="captcha" src="library/vender/securimage/securimage_show.php" alt="CAPTCHA Image" />
Show a Different Image<br/>
<div class="form-group" style="margin-top: 10px;">
<input type="text" class="form-control" name="captcha_code" id="captcha_code" placeholder="For security, please enter the code displayed in the box." />
<span class="help-block" style="display: none;">Please enter the code displayed within the image.</span>
</div>
<span class="help-block" style="display: none;">Please enter a the security code.</span>
<button type="submit" id="feedbackSubmit" class="btn btn-purple btn-md message-btn">Submit Message</button>
</div>
</form>
Thank you so much
If you want to use your own custom form for creating new subscribers you'll need to post your data and interact with the mailchimp api found Here
Although this is possible, the way mailchimp is setup... It makes adding subscribers much more simple. I'd recommend creating your form from there end and embedding it into your html... It is mobile friendly By the way... Good Luck !
If you want to integrate users to Mailchimp then the simple way is to use Mailchimp embed forms. This is very easy and simple. Just put the embed code in your page and it start working.
http://kb.mailchimp.com/article/how-can-i-add-my-signup-form-on-my-website/