• 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

Anchor Tag passing an input variable

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have to pass to an anchor tag , the input value of a text field , which is dynamically created.
I am using XHTML and dont want to use javascript as I am writing this for WAP pages, and some phones do not like javascripts. $(sterm) never gets evaluated. Please help me.
The code is as follows:
<table>
<tr>
<td valign="middle">
<input name="sterm" type="text" title="Search Term" class="tx1" style="width:40px;" size="5" maxlength="30"/>
</td>
<td>
<a href="./endUserWMLSearchDirectory?term=$(sterm)"><img src="images/search_gui_btn.gif" width="56" height="18" /> </a>
</td>

</tr>
</table>
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is this page created? The "$(sterm)" seems to indicate some kind of templating engine or server-side language.
 
Smitha Mathew
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use the same page format for XHTML and WML. WML works fine with $(sterm). I try to use the same for XHTML and it does not work fine. I also tried using JSTL <c ut value="${sterm}"/>. I cannot use javascript to access the DOM as I am writing my pages for mobile devices, and some of the devices hate javascript. I cannot also use a <input type="submit" src="test.gif" /> as images cannot be rendered across devices uniformly
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you're using JSP to generate the pages. In JSP the notation $(...) has no meaning, but ${...} does.

I also tried using JSTL <c ut value="${sterm}"/>


And the result of that was ... ?
[ August 31, 2005: Message edited by: Ulf Dittmer ]
 
Smitha Mathew
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
term=<c: out value="${sterm}"/> returned term= null when I debugged the servlet.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
c: out does not return anything; it does something (it prints something to the output stream). Are you saying it did not print anything to the output stream?
 
Smitha Mathew
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am appendind to the url on <a href , the parameter term=<c: out value="${sterm}" />, this is to call the url, with this parameter also.
But c: out does not recognise that input text is changed, as it is a server call.
Is there a way I can access the input value typed in, other than using the DOM and javascript.
Javascript is not widely accepted across phones and so javascripts are fairly discouraged in my world of writing pages to devices.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic