• 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

How to get the form parameter in the HTML page?

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am calling a html page from another html page.. I am passing the form parameters.. How can I get those form parameter in the HTML page..
My first html:

How can I get the Plan_Sponsor value in the result.html page?

Please help me..
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<form method="get" action="result.html?val=getElementById('Plan_Sponsor').value>

The value will pass as querystring. And you can access the this value from next page.

Thanks & Regards
Prithiraj
 
Jessica James
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.. i could pass it.. I dont know how to access it in the result.html..

Can you help me..
 
Prithiraj Sen Gupta
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What Platform are you using? JSP or .Net?
 
Jessica James
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am just doing the mock up screens using html..
My platform is jsp..
 
Prithiraj Sen Gupta
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%=request.getParameter("val");%>

Just put this tag where you want the value to get displayed(in textbox or labels or in table columns).
 
Jessica James
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I use this <%=request.getParameter("val");%> in the html, without running the server?
 
Prithiraj Sen Gupta
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No You have to compile it in the server.
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jessica James:
Can I use this <%=request.getParameter("val");%> in the html, without running the server?



have you try this?
[ April 13, 2007: Message edited by: Saif uddin ]
 
Jessica James
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok.. Thank you very much..
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jessica James:
i could pass it.. I dont know how to access it in the result.html..



Jessica,

You could use "window.location.search" to get the query string/search string in your result.html page. There aren't any javascript buit-in convenience methods that I know of to get the particular parameter value you want by name, though. You would have to parse the string yourself to get the value you're need, or use a library like Prototype to help you with it.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Indeed. Prototype extends the native JavaScript String object with a toQueryParams() method that does just that.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic