Dynamic Form Element Name Problems

Results 1 to 2 of 2

Thread: Dynamic Form Element Name Problems

  1. #1
    Jason Logan Guest

    Default Dynamic Form Element Name Problems

    Hi<BR><BR>I have fruitlessly tried everything to my knowledge to get over a problematic obstacle.<BR><BR>What I am doing is this:<BR><BR>I build a form for a content management system which pulls content into textarea boxes. Each textarea has a name built by the code which gets grinded through a loop:<BR><BR>&#060;textarea cols=50 rows=15 name=modBody&#060;%= objRS("id")%&#062;&#062;&#060;/textarea&#062;<BR><BR>The objRS("id") value is usually erratic due to the asp pulling out id&#039s specific to author&#039s so for example the textarea names could be:<BR><BR>modBody2<BR>modBody5<BR>modBody6<BR>mod Body7<BR><BR>Then on processing of the form (via post method to a second asp script) I need to pull the data from each of the textarea&#039s as the content may have been modified.<BR><BR>I originally thought and tried (In a loop)<BR><BR>.<BR>.<BR>dim x, temp<BR>temp = modBody & objRS("id")<BR>x = Request.Form(temp)<BR>.<BR>.<BR><BR>Now this gave me a http 500 error and seems obvious that it does not work. I also tried giving the textareas all the same name and then extracting each seperate textarea&#039s content using the split function but this has given me headaches.<BR><BR>Is there anyway I can get to these form elements values when the form element names are dynamic ?<BR><BR>Thx for any help in this desperate matter...

  2. #2
    Join Date
    Dec 1969

    Default Start with simple

    Hi,<BR>Try to put what inside of name in textarea in "",<BR>like &#060;textarea ... name="modBody&#060;%= objRS("id")%&#062;"&#062;&#060;/textarea&#062;<BR>This might help, plus as I can see it:<BR>It shouldn&#039t be temp = modBody & objRS("id")<BR>, but: temp = "modBody" & objRS("id").<BR><BR>Couple of Response.Write&#039s would help you<BR><BR><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