Simple JS question(DWR)

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jul 2004
Posts: 28
Reputation: saurav is an unknown quantity at this point 
Solved Threads: 2
saurav saurav is offline Offline
Light Poster

Simple JS question(DWR)

 
0
  #1
Sep 19th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: Simple JS question(DWR)

 
0
  #2
Sep 19th, 2007
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;
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: Simple JS question(DWR)

 
0
  #3
Sep 19th, 2007
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?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC