Request.Form collection empty on post
Finding that the request.form collection when checked on the called form is empty.
No idea as to err as no msg is displayed.
The base form is table listing the uploaded glaucoma screenings. In the table, I've added a column displaying an html input button that contains the record ID for that patient.
Various code pieces explained below.
Appreciate your comments/suggestions as I'm going bald and getting frustrated. Moving onto something else such as setting up 2 pc's...
This is the form code and a hidden field into which I place the value of the button clicked. This is I can use this value (recID) in subsequent SQL statements to retrieve the data stored in several MySQL tables associated with the patient record.
<form method="post" EncType="Multipart/Form-Data" action="http://localhost/secureeyespec/esgl001e.asp"
id="frmSelectScreen" name="frmSelectScreen" onsubmit="return form_validator();">
<input type="hidden" id="btn_clicked" name="btn_clicked" value="">
This is the button code being used.
<td width="50" align="center">
<input style="width: 4em;" type="submit" id="<%= btnName %>"
name="<%= btnName %>" size="150px" onclick="screenselected(this);"
maxlength="150" value="<%= recID %>">
Even added an HTML text field that is not visible via CSS instead of hidden field as a test - nothing was send over.
// purpose: check to see if hidden field value contains
// value of btn clicked
var hidField = document.getElementById('btn_clicked');
alert("Value of btn_clicked = " + hidField.value);
if (hidField.value != "")
alert("Value of btn_clicked NOT equal to empty string = " + hidField.value);
alert("Value of btn_clicked IS equal to empty string = " + hidField.value);
// purpose: pass to hidden field the patientID value
// obtained from the button value
var btnName = elem;
alert("btnName = " + btnName.name);
var theID = btnName.value;
alert("btnName value = " + theID);
// set hidden field value
var theField = document.getElementById('btn_clicked');
theField.value = theID;
alert("Hidden field (btn_clicked) value = " + theField.value);
// now setting the non visible text field
var nodisplay = document.getElementById('noDisplay');
nodisplay.value = theID;
alert("Text field (noDisplay) value = " + nodisplay.value);
||05-01-2013 10:16 PM
The culprit is the EncType you are using in the <form> tag.
You should only use that encoding type when you are uploading a file (using <input type="file">) and using a component that understands that encoding.
Just remove the EncTyp completely and it will work.
Thanks for the info.
Just reviewing old post for request.form and one from Spudhead informed the poster to remove the enctype="text/plain".
That got me to googling and found that was just like you mentioned associated with an upload control.
Changed my test form and shazam! it worked.
Moving forward one step at a time...
|All times are GMT +1. The time now is 03:44 AM.
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.