I have a Feedburner subscription form with two buttons, one for daily news and one for weekly news. The question is how to change the value of hidden input field with name 'uri' before submitting? My solution doesn't work.
This is what I try to use:
<form id="feedburner" action="https://feedburner.google.com/fb/a/mailverify"
method="post" target="popupwindow">
<p>
<input autocomplete="off" value="Enter your email…"
onblur="if (this.value == '') {this.value = 'Enter your email…';}"
onfocus="if (this.value == 'Enter your email…') {this.value = '';}"
type="text" name="email"/>
<input type="hidden" name="uri"/>
<input type="hidden" name="loc" value="en_US"/>
</p>
<input type="submit" value="Daily" onsubmit="document.getElementsByName('uri').value = 'androidinfodaily'; window.open('https://feedburner.google.com/fb/a/mailverify?uri=androidinfodaily', 'popupwindow'); return true" checked>
<input type="submit" value="Weekly" onsubmit="document.getElementsByName('uri').value = 'androidinfoweekly'; window.open('https://feedburner.google.com/fb/a/mailverify?uri=androidinfoweekly', 'popupwindow'); return true">
</form>
Solved
I have fixed my code and now it works. This is the final variant:
<form id="feedburner" action="https://feedburner.google.com/fb/a/mailverify"
method="post" target="popupwindow">
<p>
<input autocomplete="off" value="Enter your email…"
onblur="if (this.value == '') {this.value = 'Enter your email…';}"
onfocus="if (this.value == 'Enter your email…') {this.value = '';}"
type="text" name="email"/>
<input type="hidden" name="uri" />
<input type="hidden" name="loc" value="en_US"/>
</p>
<input type="submit" value="Daily" onclick="document.getElementsByName('uri')[0].value = 'androidinfodaily'; window.open('https://feedburner.google.com/fb/a/mailverify?uri=androidinfodaily', 'popupwindow'); return true">
<input type="submit" value="Weekly" onclick="document.getElementsByName('uri')[0].value = 'androidinfoweekly'; window.open('https://feedburner.google.com/fb/a/mailverify?uri=androidinfoweekly', 'popupwindow'); return true">
</form>