Reputation: 1062
i have an input field whose value is coming from a variable, when i submit the form record insert as an empty row :(
if i check the view-source of my page it clearly prints the value but does not insert it.
Here is the Input Field:
<input name="uid" type="text" value="<%Response.Write(studentid)%>" disabled="disabled" />
Here is the Insert Code:
<%
if request.Form("MyRecord")="Insert" then
Set InsCom=Server.CreateObject("ADODB.Command")
InsCom.ActiveConnection=objConn
InsF = Trim(request.Form("uid"))
InsF = replace(InsF,"'","''")
InsCom.CommandText = "Insert into talent_hunt(uid)Values(?) "
InsCom.Parameters.Append InsCom.CreateParameter("@uid", adVarChar, adParamInput, 255, InsF)
InsCom.Execute
response.Write"Record Inserted Successfully!<br /><a href=""talent-hunt.asp"" />Go Back to main page</a>"
end if
%>
Please help...
Upvotes: 0
Views: 586
Reputation: 2442
Use readOnly
instead of disabled
.
ref. thread: How can I get the form value from a disabled <input> element
Upvotes: 1