Suljettu

Simple PHP/JS Question-Answer

Tämä projekti myönnettiin käyttäjälle PhungTran hintaan %selected_seller_sum_sub_35% %project_currencyDetails_sign_sub_36% (USD) .

Pyydä ilmaisia tarjouksia samanlaisesta projektista
Projektin budjetti
$30 - $250 USD
Huutoja yhteensä
2
Projektin kuvaus

using just basic JS no Jquery...

We have a form that posts to another website outside of out control (to capture email address).

when the user submits the form the data is checked with a js function to validate the data...

ex:

validate(form){

var from = [url removed, login to view];

if ([url removed, login to view] === 0) {

alert("Please Enter your Email Address.");

return false;

}

The form posts to an external site (so we have no control over it) something like

[url removed, login to view]

The problem is, the form is optional, and if it is filled out we want it to post the data

as entered to the external site as normal.

However, if there is no data (someone just clicks the submit button) we want the site

to redirect the user to a different page.

Tried, if (from.length===1){ [url removed, login to view] }

(for testing to see if a [url removed, login to view] would work)

That is not working.

Probably simple for someone knowledgeable.

Recap.

Form submits to external site, if user enters nothing then redirect to a different

site/url.

Myönnetty käyttäjälle:
Vaaditut taidot

Haluatko ansaita rahaa?

  • Aseta budjettisi ja määräaika
  • Hahmottele tarjouksesi
  • Saa maksu työstäsi

Palkkaa freelancereita, jotka tekivät myös tarjouksen tästä projektista

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online