Web Development

Fillable PDF or Form

webdev: reddit for web developers - 6 hours 46 min ago

I'm trying to figure out the best way to have clients fill out a PDF on our website and then be able to submit the form electronically so that it goes directly to an internal e-mail address.

I understand I can create a fillable PDF and link that on the site, but the two limitations I see are the client needs Adobe Reader and I'd like for this to be done on mobile as well. The other dealbreaker I'm seeing is the submit button would just reference the mail client on the PC/MAC/Phone etc. I wouldn't want the client to have any input on to E-mail address or subject.

The alternative I thought of would be an online form, but I'd like the form to look like our office PDF, and I'm not sure that's doable.

Lastly, maybe an electronic signature product would work for this? I think DocuSign powerforms could accomplish this, but I know that comes with a very high price tag. Anyone know of other e-signing solutions with this feature?

Thanks for the help!

submitted by /u/birdman3
[link] [comments]
Categories: Web Development

Creating a Vue.js Serverless Checkout Form: Application and Checkout Component

CSS-Tricks - 6 hours 57 min ago

This is the third post in a four-part series. In part one, we set up a serverless Stripe function on Azure. Part two covered how we hosted the function on Github. This post will focus on wiring everything up as a Vue.js application.

Article Series:
  1. Setup and Testing
  2. Stripe Function and Hosting
  3. Application and Checkout Component (This Post)
  4. Configure the Checkout Component (Coming Soon)

Stripe has a number of ways to build out a checkout form, the most basic being a single button on the page that you trigger to pull up their custom modal. There’s a repo and component for this, but as easy as that is to implement (it's probably the most simple way to do it), I wanted a little more customization and wanted the checkout flow to be part of the page and application. This approach wouldn’t work for my needs.

Stripe Elements

Stripe also offers a thing called Elements. Elements allow you to integrate Stripe's payment system into your own checkout form and style it like your own site for a cohesive experience. It won't feel like you're using a third party plugin. They do have some pre-styled examples if you prefer something you can use right out of the box.

Luckily for us, there's a really nice repo with a Vue version of Stripe Elements called vue-stripe-elements. The repo's documentation is really nice, so you could check that out. Here's how I put it to use:

npm i vue-stripe-elements-plus --save

...or using Yarn:

yarn add vue-stripe-elements-plus

Now let's talk about our cart and integrate it.

The Cart

Here's what everything looks like as a birds eye view of the application. We've already addressed the function and stripe pieces, now let's dig into the application itself.

We're not going to go through setting up the entire application in these posts, rather just the Cart and Checkout. I'd suggest checking out the following links before continuing if you need to catch up on the basics of Vue, Vuex, and Nuxt:

In our general store set up with Vuex, we hold a manifest of all of our product data used to populate the pages with items. We'll also use that information to populate a (currently empty) cart object where items can be added for purchase. We'll use that data on a page called `Cart.vue` in the pages directory. If you're unfamiliar with Nuxt.js, it allows us to use .vue components as pages by creating them in this pages directory. We can still populate these pages with components from the components directory to create a more modular application. Here are the parts we're discussing now:

We'll need two pieces of information from that store in Vuex: the contents of the cart and the cartTotal.

We'll use computed properties in pages/Cart.vue to fetch that information so that we can cache and use them in the cart.

computed: { cart() { return this.$store.state.cart; }, cartTotal() { return this.$store.state.cartTotal; }, ... }

...and we'll create a new computed property that will store the monetary total of the items in the cart as well:

computed: { ... total() { return Object.values(this.cart) .reduce((acc, el) => acc + (el.count * el.price), 0) .toFixed(2); } }

The first thing that we'll do is see if the cart has items in it. If it does, then we need to check that the payment hasn't already been processed. We need to do this because there's no need to display a checkout form if there are no items in the cart or if payment has already been processed for the items that were added.

<div v-if="cartTotal > 0"> <!--we'll add our checkout here--> </div> <!--If the cart is empty, give them the ability to get back to the main page to add items--> <div v-else-if="cartTotal === 0 && success === false" class="empty"> <!--we'll add our empty state here--> </div> <!--If there's a success, let's let people know it's being processed, we'll add a success component later on--> <div v-else> <!--we'll add success here--> </div>

We'll also create a success property in our data that we'll initially set to false and use later to record whether or not a payment was successfully submitted.

data() { return { success: false }; },

We want to show cart items if they exist, their individual totals (as we can have multiple counts of the same item) and the final total.

<div v-if="cartTotal > 0"> <h1>Cart</h1> <div class="cartitems" v-for="item in cart" key="item"> <div class="carttext"> <h4>{{ item.name }}</h4> <p>{{ item.price | usdollar }} x {{ item.count }}</p> <p>Total for this item: <strong>{{ item.price * item.count }}</strong></p> </div> <img class="cartimg" :src="`/${item.img}`" :alt="`Image of ${item.name}`"> </div> <div class="total"> <h3>Total: {{ total | usdollar }}</h3> </div> <!--we're going to add our checkout here--> </div>

We're using a filter to format the prices in US dollars. I format them this way instead of hardcoding them in case I need to support other currencies in the future.

filters: { usdollar: function(value) { return `$${value}`; } } Setting up the Checkout Component

Now we're going to create our checkout component, which will hold all of the Stripe checkout logic and connect to the serverless function we set up in Part Two. We'll register the component in the Cart.vue file:

import AppCheckout from './../components/AppCheckout.vue'; export default { components: { AppCheckout }, ... }

Here's where we're at now:

And, in the checkout component itself, we'll bring over the base for the file that we saw in the vue-stripe-elements repo documentation:

<template> <div id='app'> <h1>Please give us your payment details:</h1> <card class='stripe-card' :class='{ complete }' stripe='pk_test_XXXXXXXXXXXXXXXXXXXXXXXX' :options='stripeOptions' @change='complete = $event.complete' /> <button class='pay-with-stripe' @click='pay' :disabled='!complete'>Pay with credit card</button> </div> </template> <script> import { stripeKey, stripeOptions } from './stripeConfig.json' import { Card, createToken } from 'vue-stripe-elements-plus' export default { data () { return { complete: false, stripeOptions: { // see https://stripe.com/docs/stripe.js#element-options for details } } }, components: { Card }, methods: { pay () { // createToken returns a Promise which resolves in a result object with // either a token or an error key. // See https://stripe.com/docs/api#tokens for the token object. // See https://stripe.com/docs/api#errors for the error object. // More general https://stripe.com/docs/stripe.js#stripe-create-token. createToken().then(data => console.log(data.token)) } } } </script> Next Up...

So far, this is what the component looks like out of the box. We're going to have to update this component a bit to fit our needs, but not too much. Stay tuned tomorrow for the final installment when we connect our component to our serverless function and finish up the checkout!

Article Series:
  1. Setup and Testing
  2. Stripe Function and Hosting
  3. Application and Checkout Component (This Post)
  4. Configure the Checkout Component (Coming Soon)

Creating a Vue.js Serverless Checkout Form: Application and Checkout Component is a post from CSS-Tricks

Categories: Web Development

Do you think this can be recreated with Bootstrap or something similar to make it responsive?

webdev: reddit for web developers - 7 hours 5 min ago

Here it is: link I plan to slice the illustrations and do the text in HTML and CSS but how to make it responsive and align it right?

submitted by /u/Mariciano
[link] [comments]
Categories: Web Development

Advice for a newbie on webdev

webdev: reddit for web developers - 7 hours 36 min ago

Hi Long time windows desktop developer. My new project is a very simple web site. Logins and Sales reports that can be downloaded as TXT files.

Please, advice me about how to do it.

Right now I have Visual Studio 2013.


submitted by /u/zaphod4th
[link] [comments]
Categories: Web Development

Should one code all basic functionality and GUIs (managing articles, etc.) for every small business website one makes from scratch, or are there some shorcuts that can be taken?

webdev: reddit for web developers - 7 hours 38 min ago

Firstly, I apologize for the unwieldy title.

In context of small business websites with little extraordinary functionality, using a CMS has quite a few benefits, especially that most of the common functionality like adding and managing articles and pages is built-in and easy to use for the future website owner.

However, in the past few years, webdev seems to have shifted from CMSs to backend frameworks like Laravel or Django. There are advantages like the fact that they aren't as bloated with useless functionality and impose fewer restrictions on developers, when they attempt to create something non-standard. On the other hand, they do basically nothing on their own. Every project needs to be coded from scratch, or at least so it seems to me.

So, here are my (hopefully not too dumb) questions: When you create a new project in *insert backend framework here*, do you always code the backend and the admin GUI from zero specifically for that project, or have you coded up some default that you drop in and customize? Are there any standalone admin interfaces that one can include into the project and just link up with the rest of the backend? Or do you still use a CMS (and is it somehow possible to use them with frontend frameworks to create SPAs?)?

submitted by /u/IridiumPoint
[link] [comments]
Categories: Web Development

Drupal Dev Thursdays: Post here with development questions or discussion

This is the weekly thread for development questions or chit-chat that doesn't belong in the Monday Beginner Questions thread. All questions/comments/ranting about Drupal dev is fair game.

(Check out the weekly post schedule in the sidebar)

submitted by /u/AutoModerator
[link] [comments]

What do you really need from a UI kit in 2018?

webdev: reddit for web developers - 8 hours 27 min ago

I'm trying to build a UI kit that devs will want to use in their web projects.

Currently, I'm in a stage of shaping the final product (planned v1 late January) and want to know what common mistakes and nuisances to avoid.

Apart from the obvious, so far I know that it should be:

  • Open-sourced
  • Based on modules - you build the kit only of the components you need in the project
  • Lightweight documentation - no modals, banners etc. simplicity at its best

What are the things that irritate you the most about such frameworks?

I would be grateful for any other tips.

I've asked the same question on /r/frontend, but got only a few answers. I've been asked to let know when it's out, so I've set up a simple page with a waiting list. Please, feel invited to join.

submitted by /u/Bolduro
[link] [comments]
Categories: Web Development

Should web developers learn digital marketing?

webdev: reddit for web developers - 8 hours 35 min ago

Should developers learn how to design and build sites that support digital marketing? For example, every site needs to support things like on-page & technical SEO, social media tags (OG tags) and Analytics tracking. So the developer should ideally knopw how to incorporate these in the site. I have had trouble with some web developers in the past who knew their coding but had trouble when it came to building a marketing ready site.

submitted by /u/Vishal_TE
[link] [comments]
Categories: Web Development

Business guy stealing credit for engineer's work?

webdev: reddit for web developers - 9 hours 5 min ago

We have a business/product guy who is working as a middleman between us (Engineers) and other people/departments in the company. It seems every compliment about our work goes through him, and sometimes he tells us what he heard, but I'm not too sure if he's relaying our names to people that matter.

What do we do in this situation?

submitted by /u/robolab-io
[link] [comments]
Categories: Web Development

Node.js ECommerce engine for audio file sales/digital content?

webdev: reddit for web developers - 9 hours 24 min ago

Hey all,

I'm working on a project where we're looking to set up a sound effects store of sorts (similar in concept to https://www.sounddogs.com/). The most important components would be the list of sounds, the ability to preview files (audio player) and basket handling.

Another requirement for our site is the inclusion of a separate section to generate sounds on the fly which can then be sold (i.e. content and price will be determined upon generation, not stored in a DB/server for anyone else to access).

I've been looking around for readily available e-commerce solutions but can't find one that quite fits the bill (i.e. lets you customise the theme enough to offer audio previews and custom labelling based on DB entries, as well as tying in the sale of generated content).

I've looked into Wordpress too but once again not much luck there.

I've been doing my research do custom-build this myself (looking at a Node.js environment) and the number of components that need serious individual attention is piling up (basket handling, payment gateway, user management and authentication etc.). I was wondering if there are any resources I might have missed.

Any pointers?

submitted by /u/ZeeMan89
[link] [comments]
Categories: Web Development

Advanced HTTP Client

webdev: reddit for web developers - 10 hours 49 min ago

Hi everyone,

I would like to share a project of ours, which I think you might find useful for everyday tasks related to web development and security. The project is called Rest. More information can be found here.

The tool was built over the last year. It is based on React and incorporates a lot of technologies we built over time. The final bundle is about 12 megabytes in size in our dev environment (huge!) but minified and compressed is bellow a megabyte and with caching it is very snappy.

We tried to make the tool as functional as possible on par with existing tools such as Paw, Postman, Insomnia, etc. The best feature, which we borrowed from Paw, is the dynamic variables, encoders, decoders and other transformation modules. It is all done via UI widgets so it is very dynamic.

Another feature is the fiddle mode. Like jsfiddle you can snapshot your current work and share it with an user-friendly url. You can also add some notes. We hope that overtime the community will make some interesting contributions. We are building a page where the best contributions will show up and also each contribution is linked to the creator's profile where karma points can be accumulated.

We will add next the ability to encrypt your fiddles with a passphrase and also create collections for more consistent API development.

Any suggestions how to make Rest better are welcome and of course we will be trilled if you give it a try and more so if you find it useful.

I would like to be upfront. Yes we are trying to make our apps supported commercially so that we can continue working on them, making them better, but what is even more important for us, especially me personally, is to build something useful. So there are just a few extra features which are available for pro users like the ability to send the requests from different locations and security testing. That being said we will never reduce the tool's function to convert users. In other words the tool will always be useful and complete and you don't need registration to use it.

submitted by /u/_pdp_
[link] [comments]
Categories: Web Development

Optimising MySQL server queries and general tips - any and all appreciated!

webdev: reddit for web developers - 11 hours 7 min ago

As per title - looking into indexing now, but if there's any others i would love to hear them :)

Thanks for your time!

submitted by /u/jakequade
[link] [comments]
Categories: Web Development