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>
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>