Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prepopulating forms

Status
Not open for further replies.

homeguard

IS-IT--Management
Jul 12, 2007
47
US
I am looking to prepopulate a form i made with ASP, i dont have control over the programming of the form but i do know what the fields are called that are on the form. Is there anyway to make this work without reprogramming the form? can i reference the field name somehow to get this done?

ASP:
Default.asp?prepop=yes&member_id=1235-456-7890&member_plan_code=United
 
You made a form but you don't have any control over the programming of the form?

I don't understand.

If you could change the programming, you might want somethng like this:
Code:
<tr>
  <td>
    Member ID:
    <input name="member_id"
<% 
  If Request("prepop") = "yes" Then
    Response.Write "value='" & Request("member_id") & "' "
  End If
%>
           type="text">
  </td>
</tr>
<td>
  <td>
    Member ID:
    <input name="member_plan_code"
<% 
  If Request("prepop") = "yes" Then
    Response.Write "value='" & Request("member_plan_code") & "' "
  End If
%>
           type="text">
  </td>
</tr>

[... snip ...]
 
I have done this many times, by re-using code.

However, you need access to the form, of course, and to the data that you wish to populate the form with.

I have, for example, a form that I use to enter data, but also the same form to review data that has been previously entered.

Both times, I build the form, but then I dynamically create javascript to populate the form if it is necessary.

I can include an example, if you wish.



Just my 2¢
-Cole's Law: Shredded cabbage

--Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top