Meaningless Drivel is fun!*
The moose likes JSP and the fly likes indexof in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "indexof in jsp" Watch "indexof in jsp" New topic
Author

indexof in jsp

ketandba shah
Greenhorn

Joined: Feb 05, 2005
Posts: 22
i am beginer in jsp & java script.
here is my code.

*******
<SCRIPT LANGUAGE="JavaScript">
function DoInit(){
document.screen.Irp__Unitnbr.selectedIndex = -1;
<% if ( screenbean.getFldVal("Irp__Unitnbr").trim().length() > 0 ) {%>
var z = 0;
for (z=0; z < document.screen.Irp__Unitnbr.options.length; z++) {

int index1 = document.screen.Irp__Unitnbr.options[z].text.indexOf("*");

if (document.screen.Irp__Unitnbr.options[z].text.substring(0,index1) == '<%=screenbean.getFldVal("Irp__Unitnbr").trim()%>' ) {
document.screen.Irp__Unitnbr.selectedIndex = z;
}
}
<% } %>



********

i want
int index1 = document.screen.Irp__Unitnbr.options[z].text.indexOf("*");

how i get index1? after that i have to implement substr(0,index1)

pl. reply

Thanks in advanced
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

how i get index1?


I have no idea what you mean by this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ketandba shah
Greenhorn

Joined: Feb 05, 2005
Posts: 22
i.e how to get from


document.screen.Irp__Unitnbr.options[z].text.indexOf("*")


e.g
document.screen.Irp__Unitnbr.options[z].text = '234567*afasfALAFD-HASA2MJA'

MY QUESTION IS IMPLEMENT indexOf on
document.screen.Irp__Unitnbr.options[z].text

document.screen.Irp__Unitnbr.options[z].text.indexOf("*") returns 6.
and then i have to implement substring(0,6)


Pl. reply
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: indexof in jsp
 
Similar Threads
JSP not working with Windows 7
Help Me Problem in REquest Dispatcher
Compare two text
Help! Explain how this servlet works?
Permutations