Email Input Pattern Attribute - php

I am in the process of using pattern for my email input field (HTML for email) to be 1234567Z#student.glasgow.ac.uk see code snippet below, I am not getting glasgow as full (only gla appears).
Have tried to manipulate this part of the email with various other strings but unable to get the correct format as outlined earlier.
Any reason why I am getting this with the code:
Email address:
<input name="email" type='email' pattern=".+ (#student.glasgow.ac.uk)" required />
<input style="float: right;" type="submit" name="submit" value="Subscribe"/>
</form>

you can try by this code
<input type="email" pattern="[a-z0-9._%+-]+#[a-z0-9.-]+\.[a-z]{2,4}$" />

Related

Joomla! Contact form inside an article, can't get action php file working

I'm trying to create a contact form on my own. I noticed that it can be achieved by placing the form inside an article, instead of a custom html module.
In the client side, it seems to work. I even added a captcha manually (the re-captcha plugin doesn't seem to work for me). The problem is, I set form's action property as "mail.php", and just added this "mail.php" file to the the template root. The "mail.php" supossedly retrieves the data send by post, and finally composes and sends the email, showing a "message send" notification.
Anyway, when I click on submit, the form page is just reloaded. I guess that Joomla! can't find my "mail.php". I guess that this issue is related to the joomla structure and my inability to place the "mail.php". Any help will be wellcome.
This is how my article looks like (wysiwyg editor mode disabled):
<form action="mail.php" method="post" target="_blank">
<p><label for="nombre">Nombre:</label></p>
<p><input maxlength="50" name="nombre" size="30" type="text" /></p>
<p><label for="email">Email:</label></p>
<p><input maxlength="50" name="email" required="required" size="30" type="text" /></p>
<p><label for="asunto">Asunto:</label></p>
<p><input maxlength="150" name="asunto" size="30" type="text" /></p>
<p><label for="mensaje">Mensaje:</label></p>
<p><textarea cols="50" maxlength="700" name="mensaje" required="required" rows="8"></textarea></p>
<div class="g-recaptcha" data-sitekey="6Lefblahblahblahblah"> </div>
<p><input type="submit" /></p>
</form>

HTML input only allow numbers and letters and #

I've got a question and I hope someone of you have a solution for this.
Well I have this code:
<input type="text" id="username" placeholder="Email/Username"
class="Username placeholder NoPlaceholder text"
title="Email/Username" name="usern" value=""
required="required" tabindex="1" maxlength="30"/>
I would like to limit this input field to only allow a full email address.
So to disallow other symbols like: !#$%^&*()_+{}|:">?<
Input pattern won't work as someone can just delete that by inspecting element.
If someone has a tip or idea comment below!
just use HTML5 field validator:
<form>
<input type="email" name="email" autocomplete="off">
<input type="submit" value="Submit">
</form>
This will force the user to enter a text string, which makes sense for an email address..
Success!
Don't use a text type, use HTML5's email type:
<input type="email" name="email">

Find pdf file with input form

I want my client to be able to download their invoice from my website.
If you have better suggestion, feel free to let me know.
I want 2 input fields. Postal code and phone number then a submit button that will go retrieve the PDF file matching the input.
<form action="#" method="post" name="Facture" class="bodytext" id="Facture">
<input name="postal" type="text" id="postal" onclick="this.value=''" value="Code Postal | H1H 1H1" size="26" /><br />
<input name="telephone" type="text" id="telephone" onclick="this.value=''" value="Téléphone | 000-000-0000" size="26" /><br />
<input class="submit" type="submit" name="envoyer" id="envoyer" value="Chercher" />
</form>
All invoices will be in a folder, let's say /invoices and file name will be H1H1H10000000000.pdf.
I want the submit button to download the file corresponding to input fields joint together.
This is what I planned but if you have a better idea to help me, all I want is my client to be able to print/download their PDF invoice and try to make sure it still private and secure.

2 form actions in interspire email marketer

My client is using interspire email marketer, which generate html form, and save all data into crm database.
In the form, there is a postcode area, my client wants to send email alert to different department based on this postcode.
I am thinking to create a seperate php file to match the postcode and send email alert.
But there is already a form.php in action. How can I add another action? Or is there any better way to achieve this?
Many Many thanks.
Below is the form code:
<form name="ppt_form" class="ppt-form" method="post" action="http://na03.mypinpointe.com/form.php?form=332" id="frmSS332">
<p><span class="required">*</span>Your Email Address:<br />
<input type="text" class="email" name="email" fid="e" fname="Email" ftype="Email" reqd="1"/></p>
<p>Phone:<br />
<input type="text" name="CustomFields[8]" id="CustomFields_8_332" value="" fid="8" fname="Phone" size='50'></p>
<p>Postal: <br />
<input type="text" name="CustomFields[20]" id="CustomFields_20_332" value="" fid="20" fname="Postal" size='50'></p>
<p><input type="button" class="update-button" value="Submit"/></p>
</form>
Eventually I leave the form with 1 action.
and add a ajax on button click.

Email contact form without PHP

I'd like to use a contact form for a website I'm creating, but PHP is not an option since the client doesn't wish to use it. Is there a clever way to work around this somehow, by sending email parameters (which is non-standard) perhaps, or by using an external contact form? Are there any good ones that don't use advertising and are easily modified to a different language for example?
Thank you.
Check out formspree.
https://github.com/asm-products/formspree
For action you simply put:
<form action="http://formspree.io/you#email.com" method="post">
<input type="text" name="name">
<input type="email" name="_replyto">
<input type="submit" value="Send">
After verifying your email after the first send this will email you the contents of the form. One thing to keep in mind is that this will take the input names. If you do not include input names it won't send you that form field.
There are hundreds of embeddable (most likely iframe-based) solutions for contact forms, which would enable you to get around using a server-side language like PHP. Just a quick google search will give you some.
Alternatively, you could make a form in HTML, and have a submit button which is actually a mailto: link, and you modify the parameters of that mailto as your form inputs change.
The only downside of this is that it's not as convenient for the user, as it then opens up their email client and they have to actually send it.
Personally, I would try and persuade the client, but if that isn't possible, then those are your options.
Check out www.enformed.io.
Has a couple of interesting options that formspree does not have( Like redirect out of the box, and a html email editor).
I used Formspree but formspree doesn't allow ajax unless you have Gold Version. It doesn't work on the basic so I am planning on making an account on enformed.io. I still haven't used it but I have heard that t is very good. You can also use alerts fro success and error messages.
<form style="margin-left: 6%;" class="email" action="https://www.enformed.io/YOUR_TOKEN" method="post">
<p>Name:</p>
<input type="text" name="first_name" />
<div id="margin" style="height: 0.5%;"></div>
<p>E-mail:</p>
<div id="margin" style="height: 0.5%;"></div>
<input type="text" name="email" />
<div id="margin" style="height: 0.5%;"></div>
<p>Subject:</p>
<div id="margin" style="height: 0.5%;"></div>
<input type="text" name="subject" />
<div id="margin" style="height: 0.5%;"></div>
<p>Message:</p>
<div id="margin" style="height: 0.5%;"></div>
<textarea name="message"></textarea>
<div id="margin" style="height: 0.5%;"></div>
<button type="submit" class="btn btn-default">Submit Form</button>
</form>
Would something as simple as a mailto form work?

Categories