correct JavaScript

  • Tila: Closed
  • Palkinto: $15
  • Vastaanotetut työt: 4
  • Voittaja: R3zu3

Kilpailun tehtävänanto

I have a plain html/css web site submitting a web form to a script (back end code) on another web site that accepts web forms submissions.

The web site with the back end code is very slow. When visitors of my web site click submit button, nothing visually changes for a while and they keep pressing it again and again thinking that the form was not submitted while in fact it was just a slow response time.

I need to prevent people from submitting many identical forms.

I adjusted my form adding a simple JavaScript that changes the value of my submit button from “SUBMIT” to “PLEASE WAIT...” and I also disable the button.

The back end script on the the other web site has some fields validation. If some fields were left empty, a simple alert message pops up telling the user “please enter...” whatever the field they missed. Then it uses history back.

When I do it on a desktop, let’s say in Google Chrome browser, when the back end script returns me back to the same form that is partially filled out to fill out more fields, my SUBMIT button is enabled again and it says (the value is) SUBMIT again.

THE PROBLEM:
when I do the same on iPhone my SUBMIT button doesn’t recover:
- I submit partially filled out form
• the back end script throws an alert message and forwards me back to previous page in history
• I end up on my partially submitted form
• But my SUBMIT button stays grayed out (disabled) and it still says “PLEASE WAIT...” So I cannot click it anymore. Unless I reload the page. But if I reload the page I lose everything what I already put on the form.

SOLUTION NEEDED
I’m looking for the best simplest and most important reliable JavaScript code that would work in every browser on every platform.
I’d like it to do what my code already does - after SUBMIT button is clicked, disable it and change the value (to say something like PLEASE WAIT”. But if the back end script forwards me back to the sane form instead of the confirmation page, my button should be active again and say SUBMIT again.

Suositellut taidot

Työnantajan palaute

“Awesome. Amazing. Professional. Great skills. Nobody else could figure out. Very impressive. ”

Profiilikuva vladtech, Canada.

Kilpailun parhaat työt

Näytä lisää töitä

Julkinen selvennystaulu

  • R3zu3
    R3zu3
    • 4 viikkoa sitten

    CHECK MY LAST REPLY

    • 4 viikkoa sitten
  • developersabbir1
    developersabbir1
    • 1 kuukausi sitten

    Can you send Your Website Url I want to visit Your Submition Form

    • 1 kuukausi sitten
    1. vladtech
      Kilpailun järjestäjä
      • 4 viikkoa sitten

      https://mycalculator.ca/test/test.htm
      and
      https://mycalculator.ca/test/test-.htm

      • 4 viikkoa sitten
  • abhuz
    abhuz
    • 1 kuukausi sitten

    hey there, is it fine if I create a fiddle to demonstrate?

    • 1 kuukausi sitten
    1. vladtech
      Kilpailun järjestäjä
      • 4 viikkoa sitten

      Is there a URL to test it? Or I can make a file and test it. Please let me know. Thank you.

      • 4 viikkoa sitten
    2. vladtech
      Kilpailun järjestäjä
      • 4 viikkoa sitten

      yes would be awesome if i had a link to test

      • 4 viikkoa sitten
  • Himal20
    Himal20
    • 4 viikkoa sitten

    I guess you have already found your solution?

    • 4 viikkoa sitten
    1. vladtech
      Kilpailun järjestäjä
      • 4 viikkoa sitten

      no, not yet. this is my code that has a problem. the server side is just a demo

      • 4 viikkoa sitten
    2. vladtech
      Kilpailun järjestäjä
      • 4 viikkoa sitten

      https://mycalculator.ca/test/test.htm
      and
      https://mycalculator.ca/test/test-.htm

      • 4 viikkoa sitten
  • filipeferreira1
    filipeferreira1
    • 1 kuukausi sitten

    So.. You want an image with a better javascript code ?

    • 1 kuukausi sitten
    1. vladtech
      Kilpailun järjestäjä
      • 1 kuukausi sitten

      i'm sorry i don't understand what do you mean by image. why image? plain text of the code is good enough. i just need it to be as simple as possible and reliable. working reliably on all platforms and browsers. with my problem fixed.

      • 1 kuukausi sitten

Näytä lisää kommentteja

Kuinka päästä alkuun kilpailuiden kanssa

  • Ilmoita kilpailusi

    Ilmoita kilpailusi Nopeaa ja helppoa

  • Saat valtavasti töitä

    Vastaanota tonnikaupalla osallistumisia Ympäri maailmaa

  • Myönnä palkinto parhaalle työlle

    Myönnä palkinto parhaalle työlle Lataa tiedostot - Helppoa!

Ilmoita kilpailu nyt tai liity tänään!