1

Essentially, I have a form that has data required to be written to a database/exported or sent to someone. However, I am unable to use a server side language like PHP as this form is hosted on Shopify. I did not use Shopify's form builder or any of the form plugins as there was a lot of logic jumping and calculation in the form. The form was made with Bootstrap + JavaScript for the calculation/logic.

I understand that this might be an impossible task, but no harm trying I guess.

Any solution is appreciated, thank you!

narypigeon
  • 103
  • 1
  • 10
  • 1
    You can use session and local storage for this (javascript) – Ahmed Ali Dec 05 '19 at 09:19
  • It's not impossible, you can do it to e.g. Google Sheets https://stackoverflow.com/questions/38857531/how-to-make-post-requests-to-google-spreadsheets-using-javascript/38871487 – Will Jenkins Dec 05 '19 at 09:23

1 Answers1

1

You can tryout something like this

   <form id="sendNameForm" onSubmit="sendName()">
    <input id="myName" name="name">
    <input type='submit' value='send'/>
   </form>

 function sendName(){
  let name = document.getElementById('myName').value
  localStorage.setItem('name', name)
  }
okumu justine
  • 350
  • 6
  • 11
  • How do I retrieve the data from the local storage if I do not have access to the PC it is being stored on? – narypigeon Dec 06 '19 at 01:57
  • local storage works with the browser, so you can only access the data from the specific browser in which its stored.. – okumu justine Dec 06 '19 at 07:39
  • so I would need to have access to the local browser it's stored in then..? Or is there a way to transmit that stored data over the internet automatically? – narypigeon Dec 06 '19 at 07:50
  • if you would like to send the data automatically to another server after sometime.. you can set that in code basing on some conditions or with a timer.. But i don't see much use case for that – okumu justine Dec 06 '19 at 15:24