Wizbaggd
06-03-2005, 10:17 AM
Sorry if the title may seem stupid, but it sums up the problem I am having as best I can think... here is the code I need to fix:
<script language="JavaScript">
// this script is embedded in a linked .js file
function sendMailVote(form){
var optVote = document.sendVote.vote.value;
document.sendVote.subject.value = 'Vote: ' + optVote;
document.sendVote.submit(form);
}
</script>
<script language="JavaScript">
// these html tags are just laid out for eay reading right now, in the code they are compressed to 1 line to fit in a function call: toBuff('text','more text',form); (toBuff(txt) is a document.write(txt) simplification)
toBuff('<form action="nvform.php" method="POST" name="sendVote">');
toBuff('<input type="hidden" name="subject" value="Vote: ">');
toBuff('<input type="hidden" name="success_page" value="url">');
toBuff('<input type="hidden" name="email" value="email@domain">');
toBuff('<select name="vote">');
toBuff('<option value="Option 1">Option 1</option>');
toBuff('<option value="Option 2">Option 2</option>');
toBuff('<option value="Option 3">Option 3</option>');
toBuff('</select><br>');
toBuff('<input type="button" value="Submit" onClick="sendMailVote(this.form);" name="submit">');
toBuff('</form>');
Everything writes in correctly, except the onClick="sendMailVote(this.form);" on the submit button. I cannot seem to find a work around for this.. if anyone can help it would be greatly appreciated. I cannot just write the html tags in html, I have to use the toBuff(txt); function, due to the construction of the site.
<script language="JavaScript">
// this script is embedded in a linked .js file
function sendMailVote(form){
var optVote = document.sendVote.vote.value;
document.sendVote.subject.value = 'Vote: ' + optVote;
document.sendVote.submit(form);
}
</script>
<script language="JavaScript">
// these html tags are just laid out for eay reading right now, in the code they are compressed to 1 line to fit in a function call: toBuff('text','more text',form); (toBuff(txt) is a document.write(txt) simplification)
toBuff('<form action="nvform.php" method="POST" name="sendVote">');
toBuff('<input type="hidden" name="subject" value="Vote: ">');
toBuff('<input type="hidden" name="success_page" value="url">');
toBuff('<input type="hidden" name="email" value="email@domain">');
toBuff('<select name="vote">');
toBuff('<option value="Option 1">Option 1</option>');
toBuff('<option value="Option 2">Option 2</option>');
toBuff('<option value="Option 3">Option 3</option>');
toBuff('</select><br>');
toBuff('<input type="button" value="Submit" onClick="sendMailVote(this.form);" name="submit">');
toBuff('</form>');
Everything writes in correctly, except the onClick="sendMailVote(this.form);" on the submit button. I cannot seem to find a work around for this.. if anyone can help it would be greatly appreciated. I cannot just write the html tags in html, I have to use the toBuff(txt); function, due to the construction of the site.