aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Anchor Tag passing an input variable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Anchor Tag passing an input variable" Watch "Anchor Tag passing an input variable" New topic
Author

Anchor Tag passing an input variable

Smitha Mathew
Greenhorn

Joined: Aug 22, 2004
Posts: 6
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>
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
How is this page created? The "$(sterm)" seems to indicate some kind of templating engine or server-side language.


Android appsImageJ pluginsJava web charts
Smitha Mathew
Greenhorn

Joined: Aug 22, 2004
Posts: 6
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
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
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

Joined: Aug 22, 2004
Posts: 6
term=<c: out value="${sterm}"/> returned term= null when I debugged the servlet.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
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

Joined: Aug 22, 2004
Posts: 6
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.
 
I agree. Here's the link: jrebel
 
subject: Anchor Tag passing an input variable
 
Similar Threads
problem in jsp !!!
Insert Tables(Urgent)
Creating CSS class at runtime
Getting "not a multipart request" even though the image is being saved.
Multiple forms in a single JSP page