0

I have a dummy node js server with express and I am exposing a dummy Index.html on which I have a simple form like:

<form action="/results" method="post" enctype="multipart/form-data">
          <input type="text" name="username" placeholder="Full Name" />
          <input type="text" name="email" placeholder="Email" />
          <input type="file" name="picture" />
          <input type="submit" name="submit"value="picture" />
        </form>

When the form is submitted and I'm doing the post:

app.post("/results"), function (req, res, next) { }

instead of doing the classic res.send() :

res.send(`
some html with updated data 
`)

I just want to update/inject in Index.html elements dynamically without creating a new html template and add something like Hi <span>${req.body.username}</span> <i>your profile image was updated</i>

Is that possible ?

1 Answer 1

1

If you want to pass parameters to your template you have multiple options, see this post for instance : https://stackoverflow.com/a/46722250/16956436

Sign up to request clarification or add additional context in comments.

1 Comment

it is a backup idea but still a bit rudimentary , I was thinking something like adding dynamically

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.