| Author |
How to reference a variable of jsp in the script function?
|
qingwu wang
Ranch Hand
Joined: Feb 19, 2003
Posts: 147
|
|
Hello everybody! text1 is a text component in the jsp page,I want to get text value and put it into request string.the *encodeURL*is a function in the jsp page,but I cann't get text1 value in the script.what should I do?
|
Thanks...qingwu<br />When I open my eyes,I see your pretty face.
|
 |
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1049
|
|
You've got to keep in mind what happens where with serverside JSP and clientside Javascript. "<%=encodeURL("/pdajsp/sub.jsp", request, response)%>" is JSP and handled on the server. The result of the method encodeURL and all other executed JSP is written as HTML to the page and send send to the client then. If you look at the html source in the browser you can see that the form's action-attribute contains a URL. "document.form1.text1.value" is the value of a textfield, wich assumably is changed by the user... on the client side (where else?). If you want to concatinate the textfield's value to this URL before submitting the form, you can use something like this: hth cb
|
 |
qingwu wang
Ranch Hand
Joined: Feb 19, 2003
Posts: 147
|
|
|
Thanx a lot
|
 |
 |
|
|
subject: How to reference a variable of jsp in the script function?
|
|
|