09-12-2009 01:42 PM
function changeLink(link, str1, id)
document.getElementById(link).href=str1.toString() + document.getElementById(id).value;
<a href="#" onclick="changeLink('abc', 'http://www.google.com/search?q=', 'key');" id="abc">Search</a><br />
<input type="text" id="key" value="love">
However, when I click it, there is nothing happen. (I expected that it can go to the page immediately.)
09-13-2009 08:46 AM
What version of the BlackBerry operating system are you running?
09-13-2009 10:06 AM
I am using JDE 4.7. However, I forgot to say that the html page is rendered in Browser Field instead of the BlackBerry Internet Browser.
09-13-2009 12:52 PM
Ah.. that's your problem right there.
For the full lowdown on BrowserField I have referenced another thread where I explain the differences.
09-13-2009 09:25 PM
Well.... with BrowserField you must fetch all the resources yourself via Java code for the URL selected in BrowserField. So you could do some logic in your Java code to detect that your user was on a certain page and then re-route the URL to the one you desire. This could get tricky based on how complex your logic is on your web page that wants to change the URL.
09-14-2009 01:26 AM
I use the Browser Field to read local HTML file. Thus, I cannot use the server code to dynamically generate the page. In fact, the link should be change according to the input text.