How to set an id to html:text or other jsp tags

Hi,

I want to make some validations from javascript on some text boxes.

html tags: <input type="text" id="textbox" name="textbox"> from js document.getElementById("textbox")....works fine but i'm using

jsp tags: <html:text property="textbox"> can i do something like html tags and have access to text boxes by id using getElementById?

I noticed that html:text has an attribute styleId...can someone tell me how it works

Also I have a form that i want to submit:

<html:form action="/action" method="post">

..........

<html:button value="Submit" onclick="submitValid()"></html:button>

</html:form>

the js:

function submitValid(){

//make some validations

document.forms.submit()

}

I get an error: A run-time error has occurred

Object doesn't support property or method

Thanks in advance,

David

[945 byte] By [Ichybana] at [2007-11-27 6:33:28]
# 1
<html:text property="textbox"> and document.getElementById("textbox") should work....try out..regardsShanu
mshanua at 2007-7-12 17:59:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks, Shanu it work

Any idea on how can i submit the form using a js function because i want to make some validations from that function?

it looks like this:

<html:form action="action.do">

//some text boxes

<html:button value="Save" property="Save" onclick="send()"></html:button>

</html:form>

Ichybana at 2007-7-12 17:59:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
hi ban u can submit the form from js function in this way...function send(){bla bla baldocument.formname.submit()}shanu
mshanua at 2007-7-12 17:59:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
but how can i set a name to a html:form because this tag is a jsp tag and it doesn't have neither name attribute nor property attribute http://struts.apache.org/1.x/struts-taglib/tlddoc/index.htmlmy form looks like this: <html:form action="/action.do" methos="post">
Ichybana at 2007-7-12 17:59:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Dear bro..just look back and what u have configured in ur struts-config.xml..there u would have mentioned a name for the form and would be mapped to an action...that is ur so called FORM NAME..gettin gme?regardsShanu
mshanua at 2007-7-12 17:59:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Thanks again, it worksi am a newbie in using web programming...sorry if my questions where a bit silly...the solution was simple...i have seen some solutions for my problem but there where "science fiction"
Ichybana at 2007-7-12 17:59:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
This how learning happens...we should try out all possibilitse..keep going..all the best..regardsShanu
mshanua at 2007-7-12 17:59:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
<html:text property="textbox">in js:is there a possibility that document.getElementById("textbox") myght not work on fire fox?
Ichybana at 2007-7-12 17:59:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...