Click here to Skip to main content
15,895,777 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: need help to code in java to read a text file...i am beginner in java..pls help me Pin
Richard MacCutchan27-Oct-13 23:52
mveRichard MacCutchan27-Oct-13 23:52 
QuestionRe: need help to code in java to read a text file...i am beginner in java..pls help me Pin
thatraja28-Oct-13 1:08
professionalthatraja28-Oct-13 1:08 
Questionretaining jquery datepicker data between views in ASP:MultiView Pin
Brad7323-Oct-13 6:54
Brad7323-Oct-13 6:54 
QuestionWant pop or new wtndow Pin
abmanish7123-Oct-13 6:35
abmanish7123-Oct-13 6:35 
SuggestionRe: Want pop or new wtndow Pin
ZurdoDev29-Oct-13 9:12
professionalZurdoDev29-Oct-13 9:12 
GeneralRe: Want pop or new wtndow Pin
Sunasara Imdadhusen21-May-14 23:52
professionalSunasara Imdadhusen21-May-14 23:52 
QuestionAngular/Backbone/Knockout Security Question Pin
AnalogNerd22-Oct-13 3:17
AnalogNerd22-Oct-13 3:17 
Questionusing document.forms["MbrForm"].submit(); does not work - help! Pin
Member 860517720-Oct-13 4:53
Member 860517720-Oct-13 4:53 
I have a form that I need to have two means of submitting the form. The first way is with the standard submit button. This works just fine. I also need to submit the form after the htm page has been printed using a button that calls a "printpage" function. This function prints the page, displays an alert and then is supposed to submit the form. It does everything except for submit the form. Any help figuring out why is appreciated.
The code for the htm page is shown below.

HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Membership Application</title>
</head>
<body>
<script type="text/javascript"> 
function validatezipfield(sZip) {
//removed for brevity
}
 
function validatephonenumber(sNum) {
//removed for brevity
}
 
function validateEMail(sEmail)
 {
//removed for brevity
 }
 
  
function IEVersion()
{
//removed for brevity
}
 
function printpage()
{
	if (MbrForm_Validator(document.forms["MbrForm"]))
	{
		ie = IEVersion();
		if (parseInt(ie.Version) == 8 && ie.BrowserMode != "Compat Mode")
		{
			alert("You appear to be using Internet Explorer Version 8 in a mode that will prevent the printed version of this page from having " +
				  "the radio buttons and check boxes filled in per your choices. So, please be sure to manually mark the form before you mail it.")
		}
		window.print();
		alert("Thank you for your support of the Friends. Please mail your form and check to the address shown on the printed		 page.");
//***********************************************************************************
//***********************************************************************************
//this is the line of code that does not work for me		
		document.forms["MbrForm"].submit();
//***********************************************************************************
//***********************************************************************************
	}
}
 
function valButton(btn)
{
//removed for brevity
}
 
 
 
function MbrForm_Validator(theform)
{
//removed for brevity
}
</script>
		<h1>Membership Application</h1>
		<p style="margin:0px;text-size:9px;"><sup class="required">*</sup>Denotes required information</p>
		<form id="MbrForm" name="MbrForm" method="post" action="membertest.php" onsubmit="return MbrForm_Validator(this)" target="_blank">
<p>the contents of the form itself have been removed for brevity. Only the SUBMIT and PRINT buttons remain</p>
			<p>  </p>
			<table width="75%" border="0" align="center" cellspacing="5" class="displayonly">
				<caption style="border-bottom:black solid 1px;">
					How Would You Like to Pay? 
				</caption>
				<tr>
					<td width="49%" valign="top">
						With a check<br />
						Click the "Print" button below to print this form for mailing in with your check.
					</td>
					<td width="51%" valign="top">
						On-Line with a Credit Card<br />
						Click the "Submit" button below to submit your information and pay using a credit card or PayPal.
					</td>
				</tr>
				<tr>
					<td>
						<div align="left">
							<input type="button" name="btnprint" id="btnprint" value="Print" onclick="printpage()" />
						</div>
					</td>
					<td>
						<div align="left">
							<input type="submit" name="submit" id="submit" value="Submit" />
						</div>
					</td>
				</tr>
			</table>
			
		</form>
		<div class="printonly">
			<p>
				<br /><br /><br /><br /><br />
				<hr />
				Mail with your check to:<br />
			</p>
		</div>
	</div>


</div>
</body>
</html>

Bob

QuestionDoubt in AJAX response obj Pin
Member 1013786815-Oct-13 0:19
Member 1013786815-Oct-13 0:19 
AnswerRe: Doubt in AJAX response obj Pin
thatraja15-Oct-13 5:20
professionalthatraja15-Oct-13 5:20 
QuestionScript running multiple times Pin
AnalogNerd10-Oct-13 10:49
AnalogNerd10-Oct-13 10:49 
AnswerRe: Script running multiple times Pin
DaveAuld13-Oct-13 21:38
professionalDaveAuld13-Oct-13 21:38 
AnswerRe: Script running multiple times Pin
Abhinav S13-Oct-13 23:48
Abhinav S13-Oct-13 23:48 
QuestionJS/JSON 'Desktop Notifications' Pin
Member 103209557-Oct-13 7:02
Member 103209557-Oct-13 7:02 
Questiondropdown check for same values Pin
01karan6-Oct-13 22:05
01karan6-Oct-13 22:05 
AnswerRe: dropdown check for same values Pin
DaveAuld13-Oct-13 21:46
professionalDaveAuld13-Oct-13 21:46 
AnswerRe: dropdown check for same values Pin
Abhinav S13-Oct-13 23:50
Abhinav S13-Oct-13 23:50 
GeneralRe: dropdown check for same values Pin
Sunasara Imdadhusen21-May-14 23:53
professionalSunasara Imdadhusen21-May-14 23:53 
Questionjavascript Date Issue Pin
wasim khan1-Oct-13 2:20
wasim khan1-Oct-13 2:20 
AnswerRe: javascript Date Issue Pin
Kornfeld Eliyahu Peter6-Oct-13 10:43
professionalKornfeld Eliyahu Peter6-Oct-13 10:43 
GeneralRe: javascript Date Issue Pin
Sunasara Imdadhusen21-May-14 23:54
professionalSunasara Imdadhusen21-May-14 23:54 
QuestionJquery datepicker display for multiple forms Pin
Member 1025344226-Sep-13 22:07
Member 1025344226-Sep-13 22:07 
AnswerRe: Jquery datepicker display for multiple forms Pin
AsWorks1-Oct-13 0:40
AsWorks1-Oct-13 0:40 
Questionhow to get first and last date from selected month from dropdown selected value using javascript Pin
Srinivas Uttareshwar19-Sep-13 2:39
Srinivas Uttareshwar19-Sep-13 2:39 
AnswerRe: how to get first and last date from selected month from dropdown selected value using javascript Pin
jkirkerx20-Sep-13 12:47
professionaljkirkerx20-Sep-13 12:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.