944,123 Members | Top Members by Rank

Ad:
Sep 19th, 2007
0

Simple JS question(DWR)

Expand Post »
Hi All,

I have not got much expousre into JS.I have been trying to work
Ajax with Java through DWR.

I have a code like this

[code]



<%@ taglib uri="/tags/spring-form" prefix="form" %>





<body>
<h6> Saurav </h6>
<br>


<h3>Aquofusion Testing</h3>
<form:form commandName="contact">
<table>
<tr>
<td>Hey Saurav</td>
<td><form:input path="firstName"/></td>
</tr>
<tr>
<td><form:input path="lastName"/></td>
</tr>
<td><form:input path="title"/></td>
<tr>
<tr>
<td>skills:</td>
<td><form:select path="leadSource"/></td>
<td><input type="button" value="submit" onclick="javascript:saveContact()"/></td>
</tr>
</table>
</form:form>



</body>

<script type="text/javascript" src="/servlet/dwr/util.js"></script>
<script type="text/javascript" src="/servlet/dwr/interface/Contact.js"></script>


<script langauge="JavaScript">

function callSaurav()
{
alert("hey saurav u r done man");
}

function saveContact()
{
var text=dwr.util.getValue("firstName");
alert(text);
}
</script>
</html>

[code]

i am getting the error fo dwr not found.
Fair enough it cant the reference for dwr.
Please let me know how we can include the DWR.
I have set the necessary web.xml and dwr.xml.
Similar Threads
Reputation Points: 10
Solved Threads: 2
Light Poster
saurav is offline Offline
28 posts
since Jul 2004
Sep 19th, 2007
0

Re: Simple JS question(DWR)

Hi saurav!
I'm not sure what is in the dwr package, but you might not be referencing it correctly? Perhaps it is
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. util.getValue("firstName");
? However you can do the same like this:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. var text=document.getElementById("firstName").value;
Reputation Points: 20
Solved Threads: 5
Junior Poster
alpha_foobar is offline Offline
182 posts
since May 2005
Sep 19th, 2007
0

Re: Simple JS question(DWR)

But you'd need to put an ID on the for input fields - can you do this with JSP? I don't see why not?

But you may just have your naming wrong?
Reputation Points: 20
Solved Threads: 5
Junior Poster
alpha_foobar is offline Offline
182 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Conditional Scroller
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: AJAX generated <select> and FIREFOX





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC