Tiffany Tiffany - 1 month ago 8
HTML Question

request() use id or name attribute classic ASP

I have a webpage that I need to fix for ADA compliance. There are a few elements that share

id
s. The form on the page uses
request()
to grab information, but it doesn't appear to be the
Request
object. I'm trying to figure out if this request function? object? uses the
name
or
id
attribute.
I'm hoping that it's the
name
attribute.

Here's an example of the ASP code:

if request("submit") = "Submit" then
session("firstName") = request("firstName")
session("middleInitial") = request("middleInitial")
session("lastName") = request("lastName")
end if


Here's the HTML:

<label>First Name: <input type="text" name="firstName" id="firstName" value="<%=session("firstName")%>"></label>
<label>Middle Initial: <input type="text" name="middleInitial" id="middleInitial" value="<%=session("middleInitial")%>"></label>
<label>Last Name: <input type="text" name="lastName" id="lastName" value="<%=session("lastName")%>"></label>


Thanks!

Answer

The id is only used client side (primarily for linking, JS, CSS and the for attribute).

The name is used to describe the data that will be encoded in the form submission (so this is what is available to your server side code).