Can I have different name and id attributes on a form element?

Posted by ewitkows on Stack Overflow See other posts from Stack Overflow or by ewitkows
Published on 2010-12-23T13:51:26Z Indexed on 2010/12/23 13:54 UTC
Read the original article Hit count: 149

Filed under:

Hi all, I have a web form with usual elements (first name, last name, etc). The Postback URL is a different website altogether as the form is intented to post lead information to another website.

The site that accepts the lead is expecting First Name to come over as "FName", and Last Name to come over as "LName". Is there any way I can set the ID of a textbox to "txtFName", but submit it over the wire as "FName"? I tried changing the name attribute, but at runtime it sets the name = id.

© Stack Overflow or respective owner

Related posts about ASP.NET