querystring to inputbox

Results 1 to 2 of 2

Thread: querystring to inputbox

  1. #1
    Join Date
    Dec 1969

    Default querystring to inputbox

    &nbsp;<BR><BR>I&#039;m sending a querystring with variables that I want to use to populate the input boxes on a form. How do I get them from the querystring to the input boxes? And I can&#039;t use ASP to set the "value" attribute of the input box because the form is created using a reusable form creation routine and going into that code would make things unnecessarily complicated.<BR><BR>I&#039;m hoping javascript will be able to set the value of an input box. Can it do that?<BR><BR>I&#039;ll also need to do a search for matching the name of the input field with the querystring variable. For example, "name" is a variable passed through the querystring, but the input box that I want this value to be placed in is named "name!S", because the form generation routine that I use appends a regexp value to the name of each input field.<BR><BR>Thanku4helping.

  2. #2
    Join Date
    Dec 1969

    Default RE: querystring to inputbox

    Do this After you for is created.<BR>&#060;Script Language="JavaScript"&#062;<BR>&#060;%<BR>For each element in Request.QueryString<BR>Response.Write "Document.formname." & element.name & "!\s.value = &#039;"& element.value &"&#039;;"<BR>Next<BR>%&#062;<BR>&#060;/script&#062;<BR><BR><BR>&#039;Note the use of [b]\[], as is an escape char is JavaScript, so the first one tells it to ignore thesecond one, else it would ignore the "s".<BR><BR>HTH.<BR>D.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts