PDA

View Full Version : Dynamic Button Text


parallon
05-03-2005, 11:29 PM
Hello all. I am new to javascript, and I am having to modify some previous code which used an image as a button and then the text (read from a database) was under the icon. I would like to use a regular button with the text of the button reading from the database instead. Can you tell me how to modify the following code to do this?

<a href="javascript:<%=href2%>" class="mnulabel"><img src="../images/del.gif" border="0" alt="<%=msg(18)%>"><br>&nbsp; <!-- <%=msg(18)%> --> &nbsp;</a>

I found something like this, but I am not sure how to integrate it.
<input type="button" name="Button" class="thisclass" value="Cancel"

Thanks,

Parallon

parallon
05-04-2005, 12:05 AM
Does this look correct???

<input type="button" name="test" class="fldlabel" value=<%=msg(8)%> onClick="javascript:<%=href2%>"

Thanks,

Parallon

_Aerospace_Eng_
05-04-2005, 12:09 AM
it looks fine, though we would need to know what that javascript is doing, is it calling a function or what exactly does it do? Do you even know.

glenngv
05-04-2005, 05:25 AM
As a good habit, you should always quote the attribute values especially if there's a possibility that the value can have spaces in it.

value="<%=msg(8)%>"