problem with form getting submitted


J

jr

This has to display in IE 7.
The form was working. I made a few changes in the html
and now when I submit it just says error loading file. My php script
does work .
The javascript validation doesn't work when you submit and the php
script doesn't fire.
I need this to work. I know it isn't perfect but there is something
minor causing the javascript to fail.

<html>
<head>
<title>Cart Inventory Upload</title>
<style>
.ast { color:red; }
td {font-family:verdana; font-size:12px; line-height:12pt;}
th {font-family:verdana; font-size:12px; line-height:12pt;}
.txt1 {font-family:verdana; font-size:20px;}
a:link {color: blue; text-decoration: none;} /* unvisited link */
a:visited {color: blue; text-decoration: none; } /* visited link */
a:hover {color: #FF00FF} /* mouse over link */
</style>

<script language='javascript'>
function validate_form(thisform) {

var sMsg='';
var sSel='N';
with (thisform) {
if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
if ( uploadedfile.value=='' ) { sMsg+="No uploaded File
\r\n"; }
for (i = 1; i < bu.length; i++) {
if ( bu.selected) { sSel='Y'; }

}
if ( sSel=='N' ) { sMsg+="No BU selected\r\n"; }

var myfile=uploadedfile;
if ( myfile.value.match(/\.csv$/gi)!=".csv") { sMsg
+="File is not a csv file.\r\n"; }


if ( sMsg.length > 0 ) {
alert(sMsg);
return false;
}else{
return true;
}
}

}


</script>
</head>
<body>
<!--<link href="http://webstyleguide.kp.org/css/rev01/default.css"
rel="stylesheet" type="text/css" />-->


</head>
<body>
<a href='admin.php'>Admin Menu<a/><br />


<form enctype='multipart/form-data' action='uploader4.php'
method='post' onsubmit='return validate_form(this);'><h2
align='center'>Cart Upload Form</h2>
<table align='center'>
<td><table cellpadding='3' cellspacing='0' border='0' style='border:
1px solid #CCCCCC' align='center'>
<th colspan='2'><span class='ast'>*</span>File to upload
<tr>
<td colspan='2'><input type='file' name='uploadedfile' size='50'
onchange='checkFileType();'>
<tr>
<th align='right'><span class='ast'>*</span>BU
<td><select name='BU'>
<option value=''></option>
<option value='08001'>08001</option>
<option value='08002'>08002</option>
<option value='08003'>08003</option>
<option value='08004'>08004</option>
<option value='08005'>08005</option>
<option value='08006'>08006</option>
<option value='08007'>08007</option>
<option value='08008'>08008</option>
<option value='08009'>08009</option>
<option value='08010'>08010</option>
<option value='08011'>08011</option>
<option value='08012'>08012</option>
<option value='08013'>08013</option>
<option value='08014'>08014</option>
<option value='08015'>08015</option>
<option value='08016'>08016</option>
<option value='08017'>08017</option>
<option value='08018'>08018</option>
<option value='08019'>08019</option>
<option value='08020'>08020</option>
<option value='08021'>08021</option>
<option value='08100'>08100</option>
<option value='08101'>08101</option>
<option value='08102'>08102</option>
<option value='08103'>08103</option>
<option value='08104'>08104</option>
<option value='08105'>08105</option>
<option value='08106'>08106</option>
<option value='08107'>08107</option>
<option value='08108'>08108</option>
<option value='08109'>08109</option>
<option value='08110'>08110</option>
<option value='08111'>08111</option>
<option value='08112'>08112</option>
<option value='08113'>08113</option>
<option value='08114'>08114</option>
<option value='08115'>08115</option>
<option value='08116'>08116</option>
<option value='08117'>08117</option>
<option value='08118'>08118</option>
<option value='08119'>08119</option>
<option value='08120'>08120</option>
<option value='08121'>08121</option>
<option value='08122'>08122</option>
<option value='08123'>08123</option>
<option value='08124'>08124</option>
<option value='08125'>08125</option>
<option value='08126'>08126</option>
<option value='08127'>08127</option>
<option value='08128'>08128</option>
<option value='08129'>08129</option>
<option value='08130'>08130</option>
<option value='08131'>08131</option>
<option value='08132'>08132</option>
<option value='08133'>08133</option>
<option value='08134'>08134</option>
<option value='08135'>08135</option>
<option value='08136'>08136</option>
<option value='08137'>08137</option>
<option value='08138'>08138</option>
<option value='08139'>08139</option>
<option value='08140'>08140</option>
<option value='08141'>08141</option>
<option value='08142'>08142</option>
<option value='08143'>08143</option>
<option value='08144'>08144</option>
<option value='08145'>08145</option>
<option value='08146'>08146</option>
<option value='08147'>08147</option>
<option value='08148'>08148</option>
<option value='08149'>08149</option>
<option value='08150'>08150</option>
<option value='08151'>08151</option>
<option value='08152'>08152</option>
<option value='08153'>08153</option>
<option value='08154'>08154</option>
<option value='08155'>08155</option>
<option value='08156'>08156</option>
<option value='08157'>08157</option>
<option value='08158'>08158</option>
<option value='08159'>08159</option>
<option value='08160'>08160</option>
<option value='08161'>08161</option>
<option value='08162'>08162</option>
<option value='08163'>08163</option>
<option value='08166'>08166</option>
<option value='08167'>08167</option>
<option value='08168'>08168</option>
<option value='08169'>08169</option>
<option value='08170'>08170</option>
<option value='08171'>08171</option>
<option value='08172'>08172</option>
<option value='08173'>08173</option>
<option value='08174'>08174</option>
<option value='08175'>08175</option>
<option value='08176'>08176</option>
<option value='08177'>08177</option>
<option value='08178'>08178</option>
<option value='08179'>08179</option>
<option value='08180'>08180</option>
<option value='08181'>08181</option>
<option value='08182'>08182</option>
<option value='08183'>08183</option>
<option value='08184'>08184</option>
<option value='08191'>08191</option>
<option value='08192'>08192</option>
<option value='08193'>08193</option>
<option value='08194'>08194</option>
<option value='08195'>08195</option>
<option value='08196'>08196</option>
<option value='08197'>08197</option>
<option value='08198'>08198</option>
<option value='08199'>08199</option>
<option value='08200'>08200</option>
<option value='08201'>08201</option>
<option value='08204'>08204</option>
<option value='08205'>08205</option>
<option value='08206'>08206</option>
<option value='08207'>08207</option>
<option value='08208'>08208</option>
<option value='08209'>08209</option>
<option value='08210'>08210</option>
<option value='08211'>08211</option>
<option value='08212'>08212</option>
<option value='08213'>08213</option>
<option value='08214'>08214</option>
<option value='08215'>08215</option>
<option value='08216'>08216</option>
<option value='08217'>08217</option>
<option value='08218'>08218</option>
<option value='08219'>08219</option>
<option value='08220'>08220</option>
<option value='08221'>08221</option>
<option value='08222'>08222</option>
<option value='08223'>08223</option>
<option value='08224'>08224</option>
<option value='08225'>08225</option>
<option value='08226'>08226</option>
<option value='08227'>08227</option>
<option value='08228'>08228</option>
<option value='08229'>08229</option>
<option value='08230'>08230</option>
<option value='08231'>08231</option>
<option value='08232'>08232</option>
<option value='08233'>08233</option>
<option value='08234'>08234</option>
<option value='08235'>08235</option>
<option value='08236'>08236</option>
<option value='08237'>08237</option>
<option value='08238'>08238</option>
<option value='08239'>08239</option>
<option value='08240'>08240</option>
<option value='08241'>08241</option>
<option value='08242'>08242</option>
<option value='08243'>08243</option>
<option value='08244'>08244</option>
<option value='08400'>08400</option>
<option value='08401'>08401</option>
<option value='08402'>08402</option>
<option value='08403'>08403</option>
<option value='08404'>08404</option>
<option value='08405'>08405</option>
<option value='08406'>08406</option>
<option value='08407'>08407</option>
<option value='08408'>08408</option>
<option value='08409'>08409</option>
<option value='08410'>08410</option>
<option value='08411'>08411</option>
<option value='08412'>08412</option>
<option value='08413'>08413</option>
<option value='08414'>08414</option>
<option value='08415'>08415</option>
<option value='08416'>08416</option>
<option value='08417'>08417</option>
<option value='08450'>08450</option>
<option value='08451'>08451</option>
<option value='08452'>08452</option>
<option value='08453'>08453</option>
<option value='08454'>08454</option>
<option value='08455'>08455</option>
<option value='08456'>08456</option>
<option value='08457'>08457</option>
<option value='08458'>08458</option>
<option value='08459'>08459</option>
</select><tr>
<th align='right'><span class='ast'>*</span>Cart ID</option>
<td><select name='Cart ID>
<br />
<b>Warning</b>: Missing argument 1 for get_cart_id(), called in C:
\Program Files\Apache Software Foundation\Apache2.2\htdocs\tools
\cart_inventory\uploader4.php on line 90 and defined in <b>C:\Program
Files\Apache Software Foundation\Apache2.2\htdocs\tools\cart_inventory
\uploader4.php</b> on line <b>276</b><br />
SELECT DISTINCT`cart_id` FROM cart_inventory WHERE cart_id!='' ORDER
BY `cart_id`<option value=''>Select Cart ID</option>
<option value='08008P009' >08008P009</option>
<option value='1' >1</option>
<option value='P0038' >P0038</option>
</select><tr>
<td align='center' colspan='2'><input type='submit' value='Upload'>
</table>
<tr>
<td><span class='ast'>*</span> - <font size='-1'><i>Required</i>
</table>
</form>
</body>
</html>


After I submit it wonks out and I get this but everything fails:


<html>
<head>
<title>Cart Inventory Upload</title>
<style>
.ast { color:red; }
td {font-family:verdana; font-size:12px; line-height:12pt;}
th {font-family:verdana; font-size:12px; line-height:12pt;}
.txt1 {font-family:verdana; font-size:20px;}
a:link {color: blue; text-decoration: none;} /* unvisited link */
a:visited {color: blue; text-decoration: none; } /* visited link */
a:hover {color: #FF00FF} /* mouse over link */
</style>

<script language='javascript'>
function validate_form(thisform) {

var sMsg='';
var sSel='N';
with (thisform) {
if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
if ( uploadedfile.value=='' ) { sMsg+="No uploaded File
\r\n"; }
for (i = 1; i < bu.length; i++) {
if ( bu.selected) { sSel='Y'; }

}
if ( sSel=='N' ) { sMsg+="No BU selected\r\n"; }

var myfile=uploadedfile;
if ( myfile.value.match(/\.csv$/gi)!=".csv") { sMsg
+="File is not a csv file.\r\n"; }


if ( sMsg.length > 0 ) {
alert(sMsg);
return false;
}else{
return true;
}
}

}


</script>
</head>
<body>
<!--<link href="http://webstyleguide.kp.org/css/rev01/default.css"
rel="stylesheet" type="text/css" />-->


</head>
<body>
<a href='admin.php'>Admin Menu<a/><br />


<form enctype='multipart/form-data' action='uploader4.php'
method='post' onsubmit='return validate_form(this);'><h2
align='center'>Cart Upload Form</h2>
target_path <br /> name<br /> tmp_name<br />Error uploading the file</
form>
</body>
</html>
 
Ad

Advertisements

J

Jeff North

On Mon, 5 Jul 2010 23:28:54 -0700 (PDT), in comp.lang.javascript jr
<[email protected]>
| This has to display in IE 7.
| The form was working. I made a few changes in the html
| and now when I submit it just says error loading file. My php script
| does work .
| The javascript validation doesn't work when you submit and the php
| script doesn't fire.
| I need this to work. I know it isn't perfect but there is something
| minor causing the javascript to fail.

Suggestion - before submitting your work to this newsgroup could you
validate and proof-read the code first. This may save you a lot of
time trying to catch problems.

Also please learn to use the javascript debugging tools that are
available to you i.e. Firefox and Firebug. You will learn a lot more
and learn faster.

Missing DTD
| <html>
| <head>
| <title>Cart Inventory Upload</title>
| <style>
| .ast { color:red; }
| td {font-family:verdana; font-size:12px; line-height:12pt;}
| th {font-family:verdana; font-size:12px; line-height:12pt;}
| .txt1 {font-family:verdana; font-size:20px;}
| a:link {color: blue; text-decoration: none;} /* unvisited link */
| a:visited {color: blue; text-decoration: none; } /* visited link */
| a:hover {color: #FF00FF} /* mouse over link */
| </style>
|
| <script language='javascript'>
| function validate_form(thisform) {
|
| var sMsg='';
| var sSel='N';
| with (thisform) {
| if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
| if ( uploadedfile.value=='' ) { sMsg+="No uploaded File
| \r\n"; }
| for (i = 1; i < bu.length; i++) {
| if ( bu.selected) { sSel='Y'; }
|
| }
| if ( sSel=='N' ) { sMsg+="No BU selected\r\n"; }
|
| var myfile=uploadedfile;
| if ( myfile.value.match(/\.csv$/gi)!=".csv") { sMsg
| +="File is not a csv file.\r\n"; }
|
|
| if ( sMsg.length > 0 ) {
| alert(sMsg);
| return false;
| }else{
| return true;
| }
| }
|
| }
|
|
| </script>
| </head>
--------------------
| <body>
| <!--<link href="http://webstyleguide.kp.org/css/rev01/default.css"
| rel="stylesheet" type="text/css" />-->
|
|
| </head>

------------------- double body and /head elements
| <body>
| <a href='admin.php'>Admin Menu<a/><br />

Malformed closing tag said:
|
|
| <form enctype='multipart/form-data' action='uploader4.php'
| method='post' onsubmit='return validate_form(this);'><h2
| align='center'>Cart Upload Form</h2>
| <table align='center'>
| <td><table cellpadding='3' cellspacing='0' border='0' style='border:
| 1px solid #CCCCCC' align='center'>
| <th colspan='2'><span class='ast'>*</span>File to upload

No closing th tag
| <tr>
| <td colspan='2'><input type='file' name='uploadedfile' size='50'
| onchange='checkFileType();'>

checkFileType() not listed/available
| <tr>
| <th align='right'><span class='ast'>*</span>BU

No closing th tag
| <td><select name='BU'>
| <option value=''></option>
| <option value='08001'>08001</option>
| <option value='08002'>08002</option>
[snip massive option list]

Clue: if the option value is the same that is displayed within the
list then the value part can be omitted i.e.
<option value='08002'>08002</option>
to
| </select><tr>
| <th align='right'><span class='ast'>*</span>Cart ID</option>
| <td><select name='Cart ID>

<select name='Cart ID> to <select name='Cart ID'>

did you notice the following error message?
| <br />
| <b>Warning</b>: Missing argument 1 for get_cart_id(), called in C:
| \Program Files\Apache Software Foundation\Apache2.2\htdocs\tools
| \cart_inventory\uploader4.php on line 90 and defined in <b>C:\Program
| Files\Apache Software Foundation\Apache2.2\htdocs\tools\cart_inventory
| \uploader4.php</b> on line <b>276</b><br />
| SELECT DISTINCT`cart_id` FROM cart_inventory WHERE cart_id!='' ORDER
| BY `cart_id`<option value=''>Select Cart ID</option>

Note how error message corrupts the html code.
| <option value='08008P009' >08008P009</option>
| <option value='1' >1</option>
| <option value='P0038' >P0038</option>
| </select><tr>
| <td align='center' colspan='2'><input type='submit' value='Upload'>
| </table>
| <tr>
| <td><span class='ast'>*</span> - <font size='-1'><i>Required</i>

font element has been deprecated for a long time - use styling to
adjust font size.

No font closing tag.
| </table>
| </form>
| </body>
| </html>

[snip remainder of html]
 
S

SAM

Le 7/6/10 8:28 AM, jr a écrit :
This has to display in IE 7.
The form was working. I made a few changes in the html
and now when I submit it just says error loading file. My php script
does work .
The javascript validation doesn't work when you submit and the php
script doesn't fire.

if ( bu.selected) { sSel='Y'; }

that will give 'Y' all the time
(there is always an option selected, the default one)

var myfile=uploadedfile;
if ( myfile.value

the element "file" has no accessible value from JS
(no more allowed) (maybe yet in local ?)
Your 'if' here may (certainly do) stop the JS
I need this to work. I know it isn't perfect but there is something
minor causing the javascript to fail.

You don't need :
else {
return true;
}
just put this 'return true' at the all end of the function


Didn't we see something very close some times ago ?
(post subject : "validating a form, one required field 2" on 6/28/10)

We see here in this post any of good advices given to your previous post

Personally I do not like the system of an alert with all errors together
I prefer a sentence showed (displayed) near the faulty form element
or errors showed step by step (an element at one time)
<html>
<head>
<title>Cart Inventory Upload</title>
<style>
.ast { color:red; }
td {font-family:verdana; font-size:12px; line-height:12pt;}
th {font-family:verdana; font-size:12px; line-height:12pt;}
.txt1 {font-family:verdana; font-size:20px;}
a:link {color: blue; text-decoration: none;} /* unvisited link */
a:visited {color: blue; text-decoration: none; } /* visited link */
a:hover {color: #FF00FF} /* mouse over link */
</style>

<script language='javascript'>
function validate_form(thisform) {

var sMsg='';
var sSel='N';
with (thisform) {
if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
if ( uploadedfile.value=='' ) { sMsg+="No uploaded File
\r\n"; }
for (i = 1; i < bu.length; i++) {
if ( bu.selected) { sSel='Y'; }

}
if ( sSel=='N' ) { sMsg+="No BU selected\r\n"; }

var myfile=uploadedfile;
if ( myfile.value.match(/\.csv$/gi)!=".csv") { sMsg
+="File is not a csv file.\r\n"; }


if ( sMsg.length > 0 ) {
alert(sMsg);
return false;
}else{
return true;
}
}

}


</script>
</head>
<body>
<!--<link href="http://webstyleguide.kp.org/css/rev01/default.css"
rel="stylesheet" type="text/css" />-->


</head>
<body>
<a href='admin.php'>Admin Menu<a/><br />


<form enctype='multipart/form-data' action='uploader4.php'
method='post' onsubmit='return validate_form(this);'><h2
align='center'>Cart Upload Form</h2>
<table align='center'>
<td><table cellpadding='3' cellspacing='0' border='0' style='border:
1px solid #CCCCCC' align='center'>
<th colspan='2'><span class='ast'>*</span>File to upload
<tr>
<td colspan='2'><input type='file' name='uploadedfile' size='50'
onchange='checkFileType();'>
<tr>
<th align='right'><span class='ast'>*</span>BU
<td><select name='BU'>
<option value=''></option>
<option value='08001'>08001</option>
<option value='08002'>08002</option>
<option value='08003'>08003</option>
<option value='08004'>08004</option>
<option value='08005'>08005</option>
<option value='08006'>08006</option>
<option value='08007'>08007</option>
<option value='08008'>08008</option>
<option value='08009'>08009</option>
<option value='08010'>08010</option>
<option value='08011'>08011</option>
<option value='08012'>08012</option>
<option value='08013'>08013</option>
<option value='08014'>08014</option>
<option value='08015'>08015</option>
<option value='08016'>08016</option>
<option value='08017'>08017</option>
<option value='08018'>08018</option>
<option value='08019'>08019</option>
<option value='08020'>08020</option>
<option value='08021'>08021</option>
<option value='08100'>08100</option>
<option value='08101'>08101</option>
<option value='08102'>08102</option>
<option value='08103'>08103</option>
<option value='08104'>08104</option>
<option value='08105'>08105</option>
<option value='08106'>08106</option>
<option value='08107'>08107</option>
<option value='08108'>08108</option>
<option value='08109'>08109</option>
<option value='08110'>08110</option>
<option value='08111'>08111</option>
<option value='08112'>08112</option>
<option value='08113'>08113</option>
<option value='08114'>08114</option>
<option value='08115'>08115</option>
<option value='08116'>08116</option>
<option value='08117'>08117</option>
<option value='08118'>08118</option>
<option value='08119'>08119</option>
<option value='08120'>08120</option>
<option value='08121'>08121</option>
<option value='08122'>08122</option>
<option value='08123'>08123</option>
<option value='08124'>08124</option>
<option value='08125'>08125</option>
<option value='08126'>08126</option>
<option value='08127'>08127</option>
<option value='08128'>08128</option>
<option value='08129'>08129</option>
<option value='08130'>08130</option>
<option value='08131'>08131</option>
<option value='08132'>08132</option>
<option value='08133'>08133</option>
<option value='08134'>08134</option>
<option value='08135'>08135</option>
<option value='08136'>08136</option>
<option value='08137'>08137</option>
<option value='08138'>08138</option>
<option value='08139'>08139</option>
<option value='08140'>08140</option>
<option value='08141'>08141</option>
<option value='08142'>08142</option>
<option value='08143'>08143</option>
<option value='08144'>08144</option>
<option value='08145'>08145</option>
<option value='08146'>08146</option>
<option value='08147'>08147</option>
<option value='08148'>08148</option>
<option value='08149'>08149</option>
<option value='08150'>08150</option>
<option value='08151'>08151</option>
<option value='08152'>08152</option>
<option value='08153'>08153</option>
<option value='08154'>08154</option>
<option value='08155'>08155</option>
<option value='08156'>08156</option>
<option value='08157'>08157</option>
<option value='08158'>08158</option>
<option value='08159'>08159</option>
<option value='08160'>08160</option>
<option value='08161'>08161</option>
<option value='08162'>08162</option>
<option value='08163'>08163</option>
<option value='08166'>08166</option>
<option value='08167'>08167</option>
<option value='08168'>08168</option>
<option value='08169'>08169</option>
<option value='08170'>08170</option>
<option value='08171'>08171</option>
<option value='08172'>08172</option>
<option value='08173'>08173</option>
<option value='08174'>08174</option>
<option value='08175'>08175</option>
<option value='08176'>08176</option>
<option value='08177'>08177</option>
<option value='08178'>08178</option>
<option value='08179'>08179</option>
<option value='08180'>08180</option>
<option value='08181'>08181</option>
<option value='08182'>08182</option>
<option value='08183'>08183</option>
<option value='08184'>08184</option>
<option value='08191'>08191</option>
<option value='08192'>08192</option>
<option value='08193'>08193</option>
<option value='08194'>08194</option>
<option value='08195'>08195</option>
<option value='08196'>08196</option>
<option value='08197'>08197</option>
<option value='08198'>08198</option>
<option value='08199'>08199</option>
<option value='08200'>08200</option>
<option value='08201'>08201</option>
<option value='08204'>08204</option>
<option value='08205'>08205</option>
<option value='08206'>08206</option>
<option value='08207'>08207</option>
<option value='08208'>08208</option>
<option value='08209'>08209</option>
<option value='08210'>08210</option>
<option value='08211'>08211</option>
<option value='08212'>08212</option>
<option value='08213'>08213</option>
<option value='08214'>08214</option>
<option value='08215'>08215</option>
<option value='08216'>08216</option>
<option value='08217'>08217</option>
<option value='08218'>08218</option>
<option value='08219'>08219</option>
<option value='08220'>08220</option>
<option value='08221'>08221</option>
<option value='08222'>08222</option>
<option value='08223'>08223</option>
<option value='08224'>08224</option>
<option value='08225'>08225</option>
<option value='08226'>08226</option>
<option value='08227'>08227</option>
<option value='08228'>08228</option>
<option value='08229'>08229</option>
<option value='08230'>08230</option>
<option value='08231'>08231</option>
<option value='08232'>08232</option>
<option value='08233'>08233</option>
<option value='08234'>08234</option>
<option value='08235'>08235</option>
<option value='08236'>08236</option>
<option value='08237'>08237</option>
<option value='08238'>08238</option>
<option value='08239'>08239</option>
<option value='08240'>08240</option>
<option value='08241'>08241</option>
<option value='08242'>08242</option>
<option value='08243'>08243</option>
<option value='08244'>08244</option>
<option value='08400'>08400</option>
<option value='08401'>08401</option>
<option value='08402'>08402</option>
<option value='08403'>08403</option>
<option value='08404'>08404</option>
<option value='08405'>08405</option>
<option value='08406'>08406</option>
<option value='08407'>08407</option>
<option value='08408'>08408</option>
<option value='08409'>08409</option>
<option value='08410'>08410</option>
<option value='08411'>08411</option>
<option value='08412'>08412</option>
<option value='08413'>08413</option>
<option value='08414'>08414</option>
<option value='08415'>08415</option>
<option value='08416'>08416</option>
<option value='08417'>08417</option>
<option value='08450'>08450</option>
<option value='08451'>08451</option>
<option value='08452'>08452</option>
<option value='08453'>08453</option>
<option value='08454'>08454</option>
<option value='08455'>08455</option>
<option value='08456'>08456</option>
<option value='08457'>08457</option>
<option value='08458'>08458</option>
<option value='08459'>08459</option>
</select><tr>
<th align='right'><span class='ast'>*</span>Cart ID</option>
<td><select name='Cart ID>
<br />
<b>Warning</b>: Missing argument 1 for get_cart_id(), called in C:
\Program Files\Apache Software Foundation\Apache2.2\htdocs\tools
\cart_inventory\uploader4.php on line 90 and defined in <b>C:\Program
Files\Apache Software Foundation\Apache2.2\htdocs\tools\cart_inventory
\uploader4.php</b> on line <b>276</b><br />
SELECT DISTINCT`cart_id` FROM cart_inventory WHERE cart_id!='' ORDER
BY `cart_id`<option value=''>Select Cart ID</option>
<option value='08008P009' >08008P009</option>
<option value='1' >1</option>
<option value='P0038' >P0038</option>
</select><tr>
<td align='center' colspan='2'><input type='submit' value='Upload'>
</table>
<tr>
<td><span class='ast'>*</span> - <font size='-1'><i>Required</i>
</table>
</form>
</body>
</html>


After I submit it wonks out and I get this but everything fails:


<html>
<head>
<title>Cart Inventory Upload</title>
<style>
.ast { color:red; }
td {font-family:verdana; font-size:12px; line-height:12pt;}
th {font-family:verdana; font-size:12px; line-height:12pt;}
.txt1 {font-family:verdana; font-size:20px;}
a:link {color: blue; text-decoration: none;} /* unvisited link */
a:visited {color: blue; text-decoration: none; } /* visited link */
a:hover {color: #FF00FF} /* mouse over link */
</style>

<script language='javascript'>
function validate_form(thisform) {

var sMsg='';
var sSel='N';
with (thisform) {
if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
if ( uploadedfile.value=='' ) { sMsg+="No uploaded File
\r\n"; }
for (i = 1; i < bu.length; i++) {
if ( bu.selected) { sSel='Y'; }

}
if ( sSel=='N' ) { sMsg+="No BU selected\r\n"; }

var myfile=uploadedfile;
if ( myfile.value.match(/\.csv$/gi)!=".csv") { sMsg
+="File is not a csv file.\r\n"; }


if ( sMsg.length > 0 ) {
alert(sMsg);
return false;
}else{
return true;
}
}

}


</script>
</head>
<body>
<!--<link href="http://webstyleguide.kp.org/css/rev01/default.css"
rel="stylesheet" type="text/css" />-->


</head>
<body>
<a href='admin.php'>Admin Menu<a/><br />


<form enctype='multipart/form-data' action='uploader4.php'
method='post' onsubmit='return validate_form(this);'><h2
align='center'>Cart Upload Form</h2>
target_path <br /> name<br /> tmp_name<br />Error uploading the file</
form>
</body>
</html>
 
J

jr

@yahoo.com>
| This has to display in IE 7.
| The form was working.  I made a few changes in the html
| and now when I submit it just says error loading file.   My php script
| does work .
| The javascript validation doesn't work when you submit and the php
| script doesn't fire.
| I need this to work.  I know it isn't perfect but there is something
| minor causing the javascript to fail.

Suggestion - before submitting your work to this newsgroup could you
validate and proof-read the code first. This may save you a lot of
time trying to catch problems.

Also please learn to use the javascript debugging tools that are
available to you i.e. Firefox and Firebug. You will learn a lot more
and learn faster.

Missing DTD
| <html>
| <head>
|  <title>Cart Inventory Upload</title>
| <style>

|   .ast { color:red; }
|         td {font-family:verdana; font-size:12px; line-height:12pt;}
|   th {font-family:verdana; font-size:12px; line-height:12pt;}
|   .txt1 {font-family:verdana; font-size:20px;}
|   a:link {color: blue; text-decoration: none;}     /* unvisited link */
|   a:visited {color: blue; text-decoration: none; }  /* visited link */
|   a:hover {color: #FF00FF}   /* mouse over link */
| </style>
|
|      <script language='javascript'>

<script type='text/javascript'>




|     function validate_form(thisform) {
|
|   var sMsg='';
|         var sSel='N';
|   with (thisform)  {
|           if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
|                 if ( uploadedfile.value=='' ) { sMsg+="No uploaded File
| \r\n"; }
|           for (i = 1; i < bu.length; i++) {
|                   if ( bu.selected) { sSel='Y';}
|
|           }
|                 if ( sSel=='N' ) { sMsg+="No BU selected\r\n"; }
|
|                 var myfile=uploadedfile;
|                 if ( myfile.value.match(/\.csv$/gi)!=".csv")  { sMsg
| +="File is not a csv file.\r\n"; }
|
|
|           if ( sMsg.length > 0 ) {
|                   alert(sMsg);
|                   return false;
|           }else{
|                   return true;
|           }
|         }
|
|     }
|
|
| </script>
|  </head>


-------------------->|   said:
|  <!--<link href="http://webstyleguide.kp.org/css/rev01/default.css"
| rel="stylesheet" type="text/css" />-->
|
|
| </head>

------------------- double body and /head elements
| <body>
| <a href='admin.php'>Admin Menu<a/><br />

Malformed closing tag said:
|
|
| <form enctype='multipart/form-data' action='uploader4.php'
| method='post' onsubmit='return validate_form(this);'><h2
| align='center'>Cart Upload Form</h2>
|  <table align='center'>
| <td><table cellpadding='3' cellspacing='0' border='0' style='border:
| 1px solid #CCCCCC' align='center'>
| <th colspan='2'><span class='ast'>*</span>File to upload

No closing th tag
| <tr>
| <td colspan='2'><input type='file' name='uploadedfile' size='50'
| onchange='checkFileType();'>

checkFileType() not listed/available
| <tr>
| <th align='right'><span class='ast'>*</span>BU

No closing th tag
| <td><select  name='BU'>
| <option value=''></option>
| <option value='08001'>08001</option>
| <option value='08002'>08002</option>

[snip massive option list]

Clue: if the option value is the same that is displayed within the
list then the value part can be omitted i.e.
<option value='08002'>08002</option>
to
| </select><tr>
| <th align='right'><span class='ast'>*</span>Cart ID</option>
| <td><select name='Cart ID>

<select name='Cart ID> to <select name='Cart ID'>

did you notice the following error message?
| <br />
| <b>Warning</b>:  Missing argument 1 for get_cart_id(), called in C:
| \Program Files\Apache Software Foundation\Apache2.2\htdocs\tools
| \cart_inventory\uploader4.php on line 90 and defined in <b>C:\Program
| Files\Apache Software Foundation\Apache2.2\htdocs\tools\cart_inventory
| \uploader4.php</b> on line <b>276</b><br />
| SELECT DISTINCT`cart_id` FROM cart_inventory WHERE cart_id!='' ORDER
| BY `cart_id`<option value=''>Select Cart ID</option>

Note how error message corrupts the html code.
| <option value='08008P009' >08008P009</option>
| <option value='1' >1</option>
| <option value='P0038' >P0038</option>
| </select><tr>
| <td align='center' colspan='2'><input type='submit' value='Upload'>
| </table>
| <tr>
| <td><span class='ast'>*</span> - <font size='-1'><i>Required</i>

font element has been deprecated for a long time - use styling to
adjust font size.

No font closing tag.
| </table>
| </form>
| </body>
| </html>

[snip remainder of html]


I made all the changes you suggested and now I am getting a blank
page even though all the code is in view source.
What could be making it a blank page in both IE 7 and Chrome???
The only change I didn't make was the </th> because I wasn't sure
where it?
I am working on a tight deadline on vpn remotely where there is no
firefox. I will look at it in firefox debugger when I can.
Can you help me get the page to display. I think the missing anchor
to the admin page was probabaly it. Thanks so much for helping me
clean it up.
I wrote a lot of php code and waited to work on the interface till the
last really couldn't be helped this time.
thanks,



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Cart Inventory Upload</title>
<style type=""text/css">
.ast { color:red; }
td {font-family:verdana; font-size:12px; line-height:12pt;}
th {font-family:verdana; font-size:12px; line-height:12pt;}
.txt1 {font-family:verdana; font-size:20px;}
a:link {color: blue; text-decoration: none;} /* unvisited link */
a:visited {color: blue; text-decoration: none; } /* visited link */
a:hover {color: #FF00FF} /* mouse over link */
</style>

<script language='javascript'>
function validate_form(thisform) {

var sMsg='';
var sSel='N';
with (thisform) {
if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
if ( uploadedfile.value=='' ) { sMsg+="No uploaded File
\r\n"; }
for (i = 1; i < bu.length; i++) {
if ( bu.selected) { sSel='Y'; }

}
if ( sSel=='N' ) { sMsg+="No BU selected\r\n"; }

var myfile=uploadedfile;
if ( myfile.value.match(/\.csv$/gi)!=".csv") { sMsg
+="File is not a csv file.\r\n"; }


if ( sMsg.length > 0 ) {
alert(sMsg);
return false;
}else{
return true;
}
}

}


<script type='text/javascript'>
</head>
<body>
<a href='admin.php'>Admin Menu</a><br />


<form enctype='multipart/form-data' action='uploader4.php'
method='post' onsubmit='return validate_form(this);'><h2
align='center'>Cart Upload Form</h2>
<table align='center'>
<td><table cellpadding='3' cellspacing='0' border='0' style='border:
1px solid #CCCCCC' align='center'>
<th colspan='2'><span class='ast'>*</span>File to upload
<tr>
<td colspan='2'><input type='file' name='uploadedfile' size='50'
onchange='checkFileType()not listed/available;'>
<tr>
<th align='right'><span class='ast'>*</span>BU
<td><select name='BU'>
<option value=''></option>
<option value='08001'>08001</option>
<option value='08002'>08002</option>
<option value='08224'>08224</option>
<option value='08225'>08225</option>
<option value='08226'>08226</option>
<option value='08227'>08227</option>
<option value='08228'>08228</option>
<option value='08229'>08229</option>
<option value='08230'>08230</option>
<option value='08231'>08231</option>
<option value='08232'>08232</option>
<option value='08233'>08233</option>
<option value='08234'>08234</option>
<option value='08235'>08235</option>
<option value='08236'>08236</option>
<option value='08237'>08237</option>
<option value='08238'>08238</option>
<option value='08239'>08239</option>
<option value='08240'>08240</option>
<option value='08241'>08241</option>
<option value='08242'>08242</option>
<option value='08243'>08243</option>
<option value='08244'>08244</option>
<option value='08400'>08400</option>
<option value='08401'>08401</option>
<option value='08402'>08402</option>
<option value='08403'>08403</option>
<option value='08404'>08404</option>
<option value='08405'>08405</option>
<option value='08406'>08406</option>
<option value='08407'>08407</option>
<option value='08408'>08408</option>
<option value='08409'>08409</option>
<option value='08410'>08410</option>
<option value='08411'>08411</option>
<option value='08412'>08412</option>
<option value='08413'>08413</option>
<option value='08414'>08414</option>
<option value='08415'>08415</option>
<option value='08416'>08416</option>
<option value='08417'>08417</option>
<option value='08450'>08450</option>
<option value='08451'>08451</option>
<option value='08452'>08452</option>
<option value='08453'>08453</option>
<option value='08454'>08454</option>
<option value='08455'>08455</option>
<option value='08456'>08456</option>
<option value='08457'>08457</option>
<option value='08458'>08458</option>
<option value='08459'>08459</option>
</select><tr>
<th align='right'><span class='ast'>*</span>Cart ID</option>
<td><select name='Cart ID>
</select><tr>
<td align='center' colspan='2'><input type='submit' value='Upload'>
</table>
<tr>
<td><span class='ast'>*</span> - <font size='-1'><i>Required</i></
font>
</table>
</form>
</body>
</html>
 
J

jr

THanks for reading this code.
I think you are saying if I I take out the else and return true like
below it will work?
Last line i was throwing out a signal and was hoping someone would see
it.



function validate_form(thisform) {

var sMsg='';
var sSel='N';
with (thisform) {
if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
if ( uploadedfile.value=='' ) { sMsg+="No uploaded File
\r\n"; }
for (i = 1; i < bu.length; i++) {
if ( bu.selected) { sSel='Y'; }

}
if ( sSel=='N' ) { sMsg+="No BU selected\r\n"; }

var myfile=uploadedfile;
if ( myfile.value.match(/\.csv$/gi)!=".csv") { sMsg
+="File is not a csv file.\r\n"; }


if ( sMsg.length > 0 ) {
alert(sMsg);
return false;
<!--}else{
// return true;
}-->
}

}
 
J

jr

By the way, you did see this before. It was a single html page with a
post to a php page which I had to redo in php at the last minute
becuase when I did it the first way I didn't realize I wouldn't have
dynamic option lists and doing that in html would have been worse than
redoing it in php. I'm apologize but it was a learning experience on
why I should have used html and php on the same page.
 
Ad

Advertisements

J

jr

Le 7/6/10 8:28 AM, jr a écrit :
This has to display in IE 7.
The form was working.  I made a few changes in the html
and now when I submit it just says error loading file.   My php script
does work .
The javascript validation doesn't work when you submit and the php
script doesn't fire.

        if ( bu.selected) { sSel='Y'; }

that will give 'Y' all the time
(there is always an option selected, the default one)

        var myfile=uploadedfile;
                  if ( myfile.value

the element "file" has no accessible value from JS
(no more allowed) (maybe yet in local ?)
Your 'if' here may (certainly do) stop the JS
I need this to work.  I know it isn't perfect but there is something
minor causing the javascript to fail.

You don't need :
        else    {
                return true;
                }
just put this 'return true' at the all end of the function

Didn't we see something very close some times ago ?
(post subject : "validating a form, one required field 2" on 6/28/10)

We see here in this post any of good advices given to your previous post

Personally I do not like the system of an alert with all errors together
I prefer a sentence showed (displayed) near the faulty form element
or errors showed step by step (an element at one time)




<html>
<head>
 <title>Cart Inventory Upload</title>
<style>
   .ast { color:red; }
        td {font-family:verdana; font-size:12px; line-height:12pt;}
   th {font-family:verdana; font-size:12px; line-height:12pt;}
   .txt1 {font-family:verdana; font-size:20px;}
   a:link {color: blue; text-decoration: none;}     /* unvisited link */
   a:visited {color: blue; text-decoration: none; }  /* visited link */
   a:hover {color: #FF00FF}   /* mouse over link */
</style>
     <script language='javascript'>
    function validate_form(thisform) {
   var sMsg='';
        var sSel='N';
   with (thisform)  {
           if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
                if ( uploadedfile.value=='' ) { sMsg+="No uploaded File
\r\n"; }
           for (i = 1; i < bu.length; i++) {
                   if ( bu.selected) { sSel='Y'; }

           }
                if ( sSel=='N' ) { sMsg+="No BU selected\r\n"; }
                var myfile=uploadedfile;
                if ( myfile.value.match(/\.csv$/gi)!=".csv")  { sMsg
+="File is not a csv file.\r\n"; }
           if ( sMsg.length > 0 ) {
                   alert(sMsg);
                   return false;
           }else{
                   return true;
           }
        }
</script>
 </head>
 <body>
 <!--<link href="http://webstyleguide.kp.org/css/rev01/default.css"
rel="stylesheet" type="text/css" />-->
</head>
<body>
<a href='admin.php'>Admin Menu<a/><br />
<form enctype='multipart/form-data' action='uploader4.php'
method='post' onsubmit='return validate_form(this);'><h2
align='center'>Cart Upload Form</h2>
 <table align='center'>
<td><table cellpadding='3' cellspacing='0' border='0' style='border:
1px solid #CCCCCC' align='center'>
<th colspan='2'><span class='ast'>*</span>File to upload
<tr>
<td colspan='2'><input type='file' name='uploadedfile' size='50'
onchange='checkFileType();'>
<tr>
<th align='right'><span class='ast'>*</span>BU
<td><select  name='BU'>
<option value=''></option>
<option value='08001'>08001</option>
<option value='08002'>08002</option>
<option value='08003'>08003</option>
<option value='08004'>08004</option>
<option value='08005'>08005</option>
<option value='08006'>08006</option>
<option value='08007'>08007</option>
<option value='08008'>08008</option>
<option value='08009'>08009</option>
<option value='08010'>08010</option>
<option value='08011'>08011</option>
<option value='08012'>08012</option>
<option value='08013'>08013</option>
<option value='08014'>08014</option>
<option value='08015'>08015</option>
<option value='08016'>08016</option>
<option value='08017'>08017</option>
<option value='08018'>08018</option>
<option value='08019'>08019</option>
<option value='08020'>08020</option>
<option value='08021'>08021</option>
<option value='08100'>08100</option>
<option value='08101'>08101</option>
<option value='08102'>08102</option>
<option value='08103'>08103</option>
<option value='08104'>08104</option>
<option value='08105'>08105</option>
<option value='08106'>08106</option>
<option value='08107'>08107</option>
<option value='08108'>08108</option>
<option value='08109'>08109</option>
<option value='08110'>08110</option>
<option value='08111'>08111</option>
<option value='08112'>08112</option>
<option value='08113'>08113</option>
<option value='08114'>08114</option>
<option value='08115'>08115</option>
<option value='08116'>08116</option>
<option value='08117'>08117</option>
<option value='08118'>08118</option>
<option value='08119'>08119</option>
<option value='08120'>08120</option>
<option value='08121'>08121</option>
<option value='08122'>08122</option>
<option value='08123'>08123</option>
<option value='08124'>08124</option>
<option value='08125'>08125</option>
<option value='08126'>08126</option>
<option value='08127'>08127</option>
<option value='08128'>08128</option>
<option value='08129'>08129</option>
<option value='08130'>08130</option>
<option value='08131'>08131</option>
<option value='08132'>08132</option>
<option value='08133'>08133</option>
<option value='08134'>08134</option>
<option value='08135'>08135</option>
<option value='08136'>08136</option>
<option value='08137'>08137</option>
<option value='08138'>08138</option>
<option value='08139'>08139</option>
<option value='08140'>08140</option>
<option value='08141'>08141</option>
<option value='08142'>08142</option>
<option value='08143'>08143</option>
<option value='08144'>08144</option>
<option value='08145'>08145</option>
<option value='08146'>08146</option>
<option value='08147'>08147</option>
<option value='08148'>08148</option>
<option value='08149'>08149</option>
<option value='08150'>08150</option>
<option value='08151'>08151</option>
<option value='08152'>08152</option>
<option value='08153'>08153</option>
<option value='08154'>08154</option>
<option value='08155'>08155</option>
<option value='08156'>08156</option>
<option value='08157'>08157</option>
<option value='08158'>08158</option>
<option value='08159'>08159</option>
<option value='08160'>08160</option>
<option value='08161'>08161</option>
<option value='08162'>08162</option>
<option value='08163'>08163</option>
<option value='08166'>08166</option>
<option value='08167'>08167</option>
<option value='08168'>08168</option>
<option value='08169'>08169</option>
<option value='08170'>08170</option>
<option value='08171'>08171</option>
<option value='08172'>08172</option>
<option value='08173'>08173</option>
<option value='08174'>08174</option>
<option value='08175'>08175</option>
<option value='08176'>08176</option>
<option value='08177'>08177</option>
<option value='08178'>08178</option>
<option value='08179'>08179</option>
<option value='08180'>08180</option>
<option value='08181'>08181</option>
<option value='08182'>08182</option>
<option value='08183'>08183</option>
<option value='08184'>08184</option>
<option value='08191'>08191</option>
<option value='08192'>08192</option>
<option value='08193'>08193</option>
<option value='08194'>08194</option>
<option value='08195'>08195</option>
<option value='08196'>08196</option>
<option value='08197'>08197</option>
<option value='08198'>08198</option>
<option value='08199'>08199</option>
<option value='08200'>08200</option>
<option value='08201'>08201</option>
<option value='08204'>08204</option>
<option value='08205'>08205</option>
<option value='08206'>08206</option>
<option value='08207'>08207</option>
<option value='08208'>08208</option>
<option value='08209'>08209</option>
<option value='08210'>08210</option>
<option value='08211'>08211</option>
<option value='08212'>08212</option>
<option value='08213'>08213</option>
<option value='08214'>08214</option>
<option value='08215'>08215</option>
<option value='08216'>08216</option>
<option value='08217'>08217</option>
<option value='08218'>08218</option>
<option value='08219'>08219</option>
<option value='08220'>08220</option>
<option value='08221'>08221</option>
<option value='08222'>08222</option>
<option value='08223'>08223</option>
<option value='08224'>08224</option>
<option value='08225'>08225</option>
<option value='08226'>08226</option>
<option value='08227'>08227</option>
<option value='08228'>08228</option>
<option value='08229'>08229</option>
<option value='08230'>08230</option>
<option value='08231'>08231</option>
<option value='08232'>08232</option>
<option value='08233'>08233</option>
<option value='08234'>08234</option>
<option value='08235'>08235</option>
<option value='08236'>08236</option>
<option value='08237'>08237</option>
<option value='08238'>08238</option>
<option value='08239'>08239</option>
<option value='08240'>08240</option>
<option value='08241'>08241</option>
<option value='08242'>08242</option>
<option value='08243'>08243</option>
<option value='08244'>08244</option>
<option value='08400'>08400</option>
<option value='08401'>08401</option>
<option value='08402'>08402</option>
<option value='08403'>08403</option>
<option value='08404'>08404</option>
<option value='08405'>08405</option>
<option value='08406'>08406</option>
<option value='08407'>08407</option>
<option value='08408'>08408</option>
<option value='08409'>08409</option>
<option value='08410'>08410</option>
<option value='08411'>08411</option>
<option value='08412'>08412</option>
<option value='08413'>08413</option>
<option value='08414'>08414</option>
<option value='08415'>08415</option>
<option value='08416'>08416</option>...

read more »

am,
It turns out I do need the return true.
What happens is it when the form won't get submitted unless it returns
true.
but thanks for pointing it out now I know what it does. Janis
 
J

Jeff North

On Tue, 6 Jul 2010 07:04:02 -0700 (PDT), in comp.lang.javascript jr
<[email protected]>
<[email protected]m>
wrote:

[snip]
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
| <html>
| <head>
| <title>Cart Inventory Upload</title>
| <style type=""text/css">

double "

[snip]

| <script type='text/javascript'>

The above should be </script>.

This <script type='text/javascript'> is supposed to have replaced this
| <td colspan='2'><input type='file' name='uploadedfile' size='50'
| onchange='checkFileType()not listed/available;'>

sigh I give up - it is obvious that you have no idea of what you are
doing. The checkFileType() function in not listed on the html you
posted therefore it is not list nor available. I didn't mean for you
to include those words after the function, as you have done.
| <tr>
| <th align='right'><span class='ast'>*</span>BU
| <td><select name='BU'>
| <option value=''></option>
| <option value='08001'>08001</option>
| <option value='08002'>08002</option>
| <option value='08003'>08003</option>
| <option value='08004'>08004</option>
| >
Extra >
[snip]
| </select><tr>
| <th align='right'><span class='ast'>*</span>Cart ID</option>
| <td><select name='Cart ID>
| </select><tr>

You have completely mangled the above block of code. You will need to
sort this out as I can not determine what you are trying to do.
 
Ad

Advertisements

S

SAM

Le 7/6/10 4:09 PM, jr a écrit :
THanks for reading this code.
I think you are saying if I I take out the else and return true like
below it will work?
Last line i was throwing out a signal and was hoping someone would see
it.

function validate_form(thisform) {

var sMsg='';

with (thisform) {
if ( cart_id.value=='' ) { sMsg+="No cart_id\r\n"; }
/* following will may not work
if (uploadedfile.value==''){ sMsg+="No uploaded File\r\n"; }
disabled */
try {
if ( uploadedfile.value=='') throw 'noFile';
}
catch (e) {
if (e) {
sMsg+="No uploaded File\r\n";
alert('coding error on file condition:\n'+e);
}
}
try {
if ( uploadedfile.value.lastIndexOf('.csv')<0 )
throw 'Not a CVS';
}
catch (e) {
if (e) {
sMsg+="File is not a csv file.\r\n";
alert('coding error on csv condition:\n'+e);
}
}
// that is 'BU' and not 'bu'
if ( BU.selectedIndex == 0 ) { sMsg+="No BU selected\r\n"; }
if ( sMsg.length > 0 ) {
alert(sMsg);
return false;
}
}
return true;
}



tested !
in particular about try ... catch
the catch calling will return :
- error of syntax in the code
- or error gotten by the element validation


Take care that your HTML contains errors of C+ code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top