Submit button
Tags: gftwhackathon
Published: 2020-05-28 20:25:53

[Instructions]: # (To submit to the Grant For The Web x DEV Hackathon, please fill out all sections.)


## What I built
A demo of a functionality that should be included in a web page that have a button of submit. The submit button will only work if the browser supports Web Monetization.

### Submission Category: 

[Note]: # (Foundational Technology, Creative Catalyst, or Exciting Experiments)
The category of this project is: Foundational Technology

## Demo
JUST COPY THE NEXT IN A FILE WITH .HTML EXTENSION.
&lt;html&gt;
&lt;head&gt;&lt;title&gt;Submit only if it supports Web Monetization&lt;/title&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
<SCRIPT LANGUAGE="JavaScript">

<!-- Oculto código a navegadores que no soportan JavaScript

function submitAllclearinFields(){
document.Datos.Vo.value="";
document.Datos.Vf.value="";
document.Datos.A.value="";
document.Datos.D.value="";
document.Datos.T.value="";
}

function resuelve(){
doc=open('','Processed',"width=350,height=400,resizable,scrollbars");
doc.document.write('<html><head> <meta name="monetization" content="$ilp.uphold.com/3L3ZYG97kmMk"><title>Submission</title></head><body>');
if (document.monetization) {
   doc.document.write('<b>Your data was submitted.</b>');
   submitAllclearinFields();
}//if (document.monetization) {
else {
   doc.document.write('<b>Your data was NOT submitted.</b>');
   doc.document.write('<b>Your browser should support web monetization.</b>');
}//else from if document.monetization
doc.document.write('</body></html>');
doc.document.close();
}
// Termino de ocultar código-->
</SCRIPT>
&lt;/SCRIPT&gt;


&lt;/head&gt;
&lt;body bgcolor="#000000" leftmargin="50" topmargin="50" marginwidth="50" marginheight="50"&gt;
&lt;form name="Datos"&gt;
&lt;center&gt;
&lt;font color="yellow"&gt;
&lt;h1&gt;Your data:&lt;/h1&gt;
&lt;/font&gt;
&lt;br /&gt;


&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;font color="white"&gt;&lt;b&gt;FILL THE FIELDS:&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;font color="white"&gt;
&lt;/font&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;br&gt;
&lt;TABLE BORDER="10" CELLPADDING="5" CELLSPACING="2" BORDERCOLOR="00FF00" bgcolor="ffffff"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;b&gt;TEMA:&lt;/b&gt; Type anything that will be submitted.
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
Name:&lt;input type="text" name="Vo" value=""&gt;&lt;br&gt;
Favorite food:&lt;input type="text" name="Vf" value=""&gt;&lt;br&gt;
Favorite drink:&lt;input type="text" name="A" value=""&gt;&lt;br&gt;
Favorite dessert&lt;input type="text" name="D" value=""&gt;&lt;br&gt;
Hobby:&lt;input type="text" name="T" value=""&gt;&lt;br&gt;
&lt;center&gt;
&lt;input type="button" name="SUBMIT" value="SUBMIT" onClick="resuelve();"&gt;
&lt;/center&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;/center&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/noscript&gt;
&lt;/html&gt;


## Link to Code

[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)


## How I built it 
In a notepad i created this web page to illustrate the functionality of the "SUBMIT" button. It will be nice to have a prebuilt button that only will works if the browser supports MONETIZATION. In other words, the function called when the button is pressed will be executed only if the browser supports WEB MONETIZATION. 

[Note]: # (For example, what's the stack? did you run into issues or discover something new along the way? etc!)


## Additional Resources/Info 


[Reminder]: # (We hope you consider expanding your submission into a full-on application for the Grant for the Web CFP, due on June 12.)