• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about Form

 
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi:
I try to do the following:
<FORM .....>
<INPUT Type=HIDDEN NAME= Array(i) Value= <%= Array(i) %> >
</FORM>
But it is not working, Name attribute is suppose to take "" value. But once I use "", i is freezed. I have an array to pass, so hope to use a loop with i as varible.
Is there any way I can get around this?
Thanks in advance!
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<form ...>
<%for(int i=0;i<Array.length;i++){%>
<input type=hidden name="<%=Array[i]%>" value="<%=Array[i]%>" >
<%}%>
</form>
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your input.
In your code: two "<%=Array[i]%>" will both be evaluated to the value of Array[i], but that is not what I want. I want to have something like:
<Input type=hidden name="Array[0]" value="World">
<Input type=hidden name="Array[1]" value="Moon">
....
 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this...
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the input!
This seems should work, but when I tried it, it is still not working. Since then, I did some reading. It looks like "(" and ")" are not allowed in name attribute.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic