Embed Tinyletter into Pelican blog as form field - html

This is a question for Tinyletter and Pelican but it is probably applicable to any static blog with a templating system.
Currently the only way to embed Tinyletter into a static blog is to use a button as a pop-up to this code:
<form style="border:1px solid #ccc;padding:3px;text-align:center;" action="https://tinyletter.com/test-user" method="post" target="popupwindow" onsubmit="window.open('https://tinyletter.com/test-user', 'popupwindow', 'scrollbars=yes,width=800,height=600');return true"><p><label for="tlemail">Enter your email address</label></p><p><input type="text" style="width:140px" name="email" id="tlemail" /></p><input type="hidden" value="1" name="embed"/><input type="submit" value="Subscribe" /><p>powered by TinyLetter</p></form>
I tried to embed this code into my Jinja2 Pelican template file with this code:
<form class="" action="https://tinyletter.com/test-user" method="POST">
<input class="" type="text" name="_replyto" placeholder="Subscribe via email" id="email">
<button class="btn" type="submit" value="Send">
Sign up
</button>
</form>
After generating it, the form field displays and the button displays. But when I test the input by adding an email address (a working one, not a throwaway that tinyletter might reject), it takes me to: https://tinyletter.com/test-user/subscribe/validate and after passing the captcha it always gives the same error:
That email doesn't look right. Please try again.
I tried to enter the same email on the https://tinyletter.com/test-user/subscribe/validate page and that works.
Is there something in the pop-up code that I need to include in my form code?

Related

Is there a way to have one single form HTML element that can send information to numerous URL's?

I'm designing a front end for Google in my class, but the only issue I'm having is that my <form> element where a user can type in keywords to send to google and get the results on their page only supports one URL to send information to.
Is there a way I can add a feature (preferably a button) to send that info to the "I'm feeling lucky" URL without having to create a separate form, using plain HTML?
I've attached some of my code if it helps.
<form action="https://google.com/search" name="Search" class="search" >
<input type="text" name="q" placeholder="Search Google or type a URL" id="query">
<input type="submit" value="Search" class="submit">
</form>
While this is typically handled with JavaScript (or server-side logic), it is indeed possible to achieve this with just HTML, as HTML5 introduces the formaction attribute on <input type="submit"> (and type="image"), which allows you to modify the submission location.
This can be used to submit to two different locations based on button click:
<form>
<input type="submit" formaction="/one" value="Submit To URL One">
<input type="submit" formaction="/two" value="Submit To URL Two">
</form>
This is supported by all modern browsers.

HTML and AngularJS Interpolation for email form

I'm using formspree.io for some simple contact forms and want to dynamically change the email address with Angular1 so it looks something like this:
<form action="https://formspree.io/{{ user.email }}" method="POST">
Can anyone help shine some light on this? I can't quite work it out so any thoughts would be massively appreciated.
go to the following link. it has clearly mensioned how to post a form in angular, jquery, etc.
https://scotch.io/tutorials/submitting-ajax-forms-the-angularjs-way
go to the formspree website. there you can see the clear explanation in traditional way
<form action="https://formspree.io/your#email.com" method="POST">
<input type="text" name="name">
<input type="email" name="_replyto">
<input type="submit" value="Send">
</form>
just convert this form into angular supported form and your work will be pretty easy if you use twoway data binding
ng-submit also works well angular documentation
<form ng-submit="submit()" ng-controller="ExampleController">
<input type="text" ng-model="text" name="text" />
<input type="submit" id="submit" value="Submit" />
</form>
here submit() is a function that trigger the post request
Trust the url input with SCE (Strict Contextual Escaping (SCE)
See sce docs

Mobile App executes html scripts

Am testing a mobile app, in one of scenario where there is option to enter text. I have inputted html code say something below and can submit it
Below codes are executed on my mobile app
enter code here
<html>
<body>
<button type="button" onclick="alert('Hello world!')">Click Me!</button>
</body>
</html>
Result: Shows the input and button controls, however button click doesn't show alert
OR
enter code here
<form action="http://google.com" method="get">
First name: <input type="text" name="fname"><br>
<button type="submit">Submit</button><br>
</form>
Result: Shows up input and button click opens targeted external page in the app.
OR
enter code here
<form action="" method="post">
<input name="username" value="admin" />
<input name="password" type="password" value="secret" />
<input name="injected" value="injected" dirname="password" />
<input type="submit">
</form>
I can even embed a youtube video and play it in app.
1.What kind of security threat is it.
2.To What extent does it harm app security.
3.Does it fall under XSS. Any example scripts to pull app info or alert popup would be helpful

I can't get my submit button to send an email, Ive tried several formats

I am using a form id= contact-form with a form loader. I have tried getting my email to submit with form action and html href however nothing has working this is what I am currently trying to get to work. any suggestions?
<form method="post" action="mailto:m_galvin1005#email.campbell.edu" >
<input type="submit" value="Send Email" />
</form>
I placed this form method inside of a form id. Not sure if thats where I am getting held up at
Unfortunately, browsers don't actually know how to send emails. The web browser only really knows how to render HTML, JS and CSS code into a visual experience.
PHP is a language that runs server-side, which you can use to tell a web server to send an email to whatever address you input.
Here's a good article on PHP Emailing: https://css-tricks.com/snippets/php/send-email/
It is important to note that this code REQUIRES a web-space or server to compile.
It will be a very basic email form, having said this I think you are missingpost argument in your form tag. The following should work
<form action="mailto:m_galvin1005#email.campbell.edu" method="post" enctype="text/plain" >
Name:<input type="text" name="Name">
Email:<input type="text" name="Email">
<input type="submit" name="submit" value="Submit">
</form>

In-page form does not send data to remotely hosted aspx form

I have an html form with the action linking to a remotely hosted aspx form. The html form mimics all the input names, ids, values, etc. of the aspx form.
After submitting the html login form with correct login data, instead of processing the data and redirecting to the target link, the page links to the raw login form with only the username data entered. Upon filling in the correct information again, the user is able to log in.
By checking the function of the other instances of the same login form on the site and encountering the same problem, I surmised that the issue is inherent in the remote aspx file, not the html form.
The form was working until about a week ago, when it promptly started behaving like this without any changes made to the code.
The live site is at http://blinqphoto.com
Thank you for any responses, this has me stumped.
Please find the html form and corresponding aspx form below.
HTML:
<form style="" name="LoginForm" method="post" action="https://acct.blinqphoto.com/loginframe.aspxredirect=http%3a%2f%2fwww.blinqphoto.com%2fmy-albums%2f" id="LoginForm">
<div>
<input name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMjU0ODEwOTIzZGR61068oyJyEBB4UM9Gc8Fxx4225NLn2XmKWX95/vl6Zg==" type="hidden">
</div>
<div>
<input name="__EVENTVALIDATION" id="__EVENTVALIDATION"value="/wEWBAL1/8vwCgKTqJrlAQKN8oRJAv6M0J8PQkj11RCPtUGzghOj3yic+Mr17E559GJ73UVSHbxO9VE=" type="hidden">
</div>
<span> Email <input name="UserNameTxt" id="UserNameTxt" placeholder="example#gmail.com" type="text"></span>
<br>
<span>Password<input name="PasswordTxt" id="PasswordTxt" placeholder="password" class="password" type="password"></span>
<br>
<input name="LoginButton" value="Sign in" class="LoginButton" type="submit"><br>
</form>
aspx:
<form style="" name="LoginForm" method="post" action="https://acct.blinqphoto.com/loginframe.aspx?redirect=http%3a%2f%2fwww.blinqphoto.com%2fmy-albums%2f" id="LoginForm">
<div>
<input name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMjU0ODEwOTIzZGR61068oyJyEBB4UM9Gc8Fxx4225NLn2XmKWX95/vl6Zg==" type="hidden">
</div>
<div>
<input name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBAL1/8vwCgKTqJrlAQKN8oRJAv6M0J8PQkj11RCPtUGzghOj3yic+Mr17E559GJ73UVSHbxO9VE=" type="hidden">
</div>
<span> Email <input name="UserNameTxt" id="UserNameTxt" placeholder="example#gmail.com" type="text"></span>
<br>
<span>Password<input name="PasswordTxt" id="PasswordTxt" placeholder="password" class="password" type="password"></span>
<br>
<input name="LoginButton" value="Sign in" class="LoginButton" type="submit"><br>
</form>
I believe this is due to the .NET event validation. If you look closely, the value of the __EVENTVALIDATION form field is not always exactly the same. This is used to validate the postback - to check that it is not coming from another URL for example, which is exactly what you are doing.
You need to disable the event validation for the login.aspx page.
Page.EnableEventValidation = false;
Is there a way to disable Event Validation for an entire page?
Note that disable event validation can possibly make your page more vulnerable.