given the html pattern attribute what's accepted number - html

I am trying to register barnes and noble account
what is the accepted phone-number format here?
I can see the HTML code for the pattern attribute is
^((1|\+1)?(\s|-|.)?)?((\(|\s\()?[2-9]{1}\d{2}|[2-9]{1}\d{2}(\)|\)\s)?)(\s|-|.)?(\d{3}(\s|-|.)?\d{4})
I tried to enter it in +1(319)123-4567
but without any luck, any ideas?

Related

Why "some#mail" applies :valid pseudo class?

I have an email input field.
I have css rules for :valid and :invalid states.
Why does "some#mail" make this field valid?
Why it's not waiting for ".com"?
Is there any way to make it behave normally?
Previously, I used JS for these purposes.
Today I'd like to resolve this without JS
some#mail is a valid email address. mail here could be a local URL with no top-level domain associated with it.
For instance, at my office we have http://wiki/ set up to take us to our company wiki. If we wanted to we could set up an email server on this with the URL example#wiki - there'd be no .com because there is no TLD here at all.
Wikipedia has a pretty good list of valid email address examples, where they include the following example in this format:
admin#mailserver1 (local domain name with no TLD)

Escaping a variable in an a href link

I'm working on a Exchange Hub Transport Rule that applies signatures from variables that are pulled in from AD. Anyways I'm trying to get the email link working and I'm having an issue trying to escape quotes variable tags to include the proper format.
Variables included are %%Email%%, here is a link to all of them http://solarz.net/?p=31
Email:%%Email%%
The Email displays correctly but the link for the email address doesnt. Just cant figure out how to include the same %%Email%% for the link.
The Last %%Email%% displays correctly.
Thanks
Fixed it using some escape characters.
Email:%%Email%%

URLENCODE Variable in Salesforce Vertical Response Email

This is a rather simple question, but I cannot find documentation about it from Salesforce.
I am setting up an HTML Newsletter from Salesforce Vertical Response, and I need to put a link in the body of the email that goes to another site which takes the user's email address as a query string. I am doing this so that when the user clicks the link from the HTML email, they will automatically be signed up for a different blog mailing list.
The link will look like this www.mywebsite.com/blog/subscribe?email=your_email#email.com.
I can easily accomplish this by using the {EMAIL_ADDRESS} variable, such that the link looks like this:
Subsribe
This workds, but when the user gets the email and clicks the link, the '#' symbol gets stripped from the URL. Now I'm trying to figure out how to get around this. I saw some documentation on the URLENCODE() function for SalesForce, but when I try to use it in the HTML email editor in SalesForce, like URLENCODE({EMAIL_ADDRESS})it doesn't execute it, and instead interprets it literally as text. Can anyone help me? is it even possible to use functions from within the SalesForce HTML email editor?
Thanks
I havent used VerticalResponse, but if it leans on salesforce communication templates then you can always create an email template as Visualforce page. Then you can apply Encode functions to merge fields.
I'm glad you were able to find a workaround. If you ever go back to dealing with the URL, it's a good idea to disable our click-tracking when working with merge fields. This can be accomplished by adding nr_ before the http. Example: Subsribe - If you ever try that and it doesn't work, or if you have any other questions, please let us know via one of our Support channels:
support#verticalresponse.com
866-683-7842 x1
We also have live chat available: http://help.verticalresponse.com/
Regards,
Keith Gluck
VerticalResponse Customer Support

How does the vcard_name attribute work re: input fields?

Can anyone explain how the (IE) vcard_name attribute works as applied to HTML input fields (see below)?
<input name="foo" vcard_name="bar">
I've read Microsoft's documentation but am still unclear. In the example above, does the inclusion of the vcard_name attribute mean that AutoComplete suggestions will be drawn exclusively from the Profile Assistant? Or will suggestions be drawn from both the Profile Assistant and the standard autocompletion store?
Also, does the inclusion of the vcard_name attribute mean that the user's input will be saved in the Profile Assistant when the form is submitted?
Hope this will help you.
Thanks
How It Works (Basically)
When you enter information into a form and submit it, Internet Explorer sets up what's known as a vCard. The reason the function is so successful is that Web authors tend to use the same NAME attributes for many form elements across pages.
For instance, I'll bet you've filled out a ton of forms that ask for your name. Allow me to demonstrate. Type the first few letters of your name in the text box just below. If you're using IE 5.0 or above, I'll bet your name appears as a choice you can make. Try it in the e-mail box, too. I'll bet you get your e-mail as a choice. It won't work for everyone, but I'll bet I get the majority of you:
If it worked for you, and I'll bet it did, you're probably wondering how I knew each item would come up. Well, first off, here's the code from the form above:
<FORM>
Name: <INPUT TYPE="text" NAME="name">
E-mail: <INPUT TYPE="text" NAME="email">
</FORM>
It's the NAME attribute that does the trick. I'm basically making a guess that sometime, somewhere, you filled out a form that asked for your name and e-mail address. In addition, I am guessing that the form used the NAME attributes "name" and "email". They are very common.
If it worked, then you have a couple of vCards on your system named "VCARD_NAME" and "VCARD_EMAIL". When you filled out the other form and submitted it, the card was created. Now, from that point on, whenever you run into a form that has an element with a NAME attribute set to "name" or "email," the text from that vCard will be suggested to you.
Let me attempt to prove that point again. Below is a form that looks exactly like the one above, except the first text box has its NAME attribute set to "griswald" and the second set to "ookook". Go ahead, try to put your name and email in. You'll get no help from AutoComplete.
You didn't get any help because you don't have VCARD_GRISWALD or VCARD_OOKOOK on your computer. Luckily, I didn't give you the opportunity to submit the form, or you would have.
Basically, the *vcard_name* attribute overrides the name attribute. It tells the browser to use the vcard_name value passed as the schema to look for AutoComplete suggestions. If this is not provided, the name attribute is used.
Specifies the vCard type to use for the Autocomplete box. Setting the
value of the vCard_name attribute causes the contents of the
Autocomplete window to depend on the value of this attribute only,
regardless of the value of the name attribute. If the value of the
vCard_name attribute is not specified, the contents of the
Autocomplete window depend on the value of the name attribute.
Source : http://help.dottoro.com/lhwgvcmt.php

How and when to use Html encode

I've recently learned that i shouldn't store html encoded data in the database, but i should rather html encode the data that is shown on the screen for the user.
No big deal, i have to fix my database records and make some code changes.
But my question is, when should I use html encode and when shouldn't I.
For example, within a html table, I'm writing directly from the database to the inner HTML of a column. Without encoding this would be dangerous, I get that.
What about when setting the value of a textbox. It seems to work without having to html encode the value. But I'm not sure why. This is what the textbox look like:
<input type="textbox" value="xxx"/>
But when setting the value to: "/><p style="font-size: 100px;">testing hack</p>
The html source will be:
<input type="textbox" value=""/><p style="font-size: 100px;">testing hack</p>
It will look fine though when viewed so the p-tag isn't working as intended by the "hack".
Is anyone getting what I'm trying to aim at :) ?
If I do try to html encode something i set to a textbox value, the result will display "&lt" and so on, which is not what I intended.
So in short: Should I only html encode stuff that is set to the innerHtml of html-controls, and not when setting the value of, for example, textboxes?
The answer came out of thejh's and my discussion in the comment to the question. I was not sure what to mark as answer so I decided to answer my own question. I hope that's ok.
It seems like when setting a value of an attribute (like the textbox's "value") .NET automatically html encodes the value so there is no need to do this by yourself.
When setting a html controls inner HTML though, it's important that you do html encode the value.
Thanks Thejh, sorry I couldn't up vote anything u wrote.
edit: I can't mark this as the answer for another 2 days.
in the case of
<input type="textbox" value="xxx"/>
'xxx' is an attribute, and you should use a different encoding. In ASP.NET it's HtmlAttributeEncode for example.
For HTML attributes, encode backslashes and double quotes.
Replace every \ by \\
Replace every " by \"
Oh, by the way: Sometimes PHP does this for you, see here.
This feature has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.