Z
Z
Zubastik_12017-10-10 12:52:50
JavaScript
Zubastik_1, 2017-10-10 12:52:50

How to let the user submit the form to the url he needs?

For example, there is a form on a page. It has a field with an url. The user must enter their url. How can I make this form go to the url entered by the user after submitting it (that is, somehow substitute this address in the code of the script that sends the form with Ajax)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alvvi, 2017-10-10
@Zubastik_1

If you have already bound the input to the property of the instance, then what prevents you from simply substituting it in the method that handles the dispatch:

const url = `http://toster.ru/${this.userUrl}`;
$.ajax({
  url,
  // ... все остальное
})

If you have problems with something more fundamental, then the documentation will help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question