1 | <!doctype html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <script type="text/javascript" src="jquery-1.4.2.js"></script> |
---|
5 | |
---|
6 | <script type="text/javascript"> |
---|
7 | $(document).ready(function() { |
---|
8 | |
---|
9 | $("#selectbox").change(function() { |
---|
10 | |
---|
11 | /* |
---|
12 | This snippet works |
---|
13 | */ |
---|
14 | $("*[id^='contactInfo.shippingAddress']").val(""); |
---|
15 | |
---|
16 | /* |
---|
17 | This snippet doesnot work |
---|
18 | */ |
---|
19 | //$("*[id^='contactInfo\\.shippingAddress']").val(""); |
---|
20 | |
---|
21 | |
---|
22 | }); |
---|
23 | |
---|
24 | |
---|
25 | } ); |
---|
26 | </script> |
---|
27 | </head> |
---|
28 | <body> |
---|
29 | <p>try starts here </p> |
---|
30 | |
---|
31 | <select id="selectbox"> |
---|
32 | <option value="1">1</option> |
---|
33 | <option value="2">2</option> |
---|
34 | <option value="3">3</option> |
---|
35 | </select> |
---|
36 | |
---|
37 | <table> |
---|
38 | <tr> |
---|
39 | <td><input id="contactInfo.shippingAddress.streetAddress1" name="contactInfo.shippingAddress.streetAddress1" type="text" value="address1" maxlength="100"/></td> |
---|
40 | |
---|
41 | |
---|
42 | <td><input id="contactInfo.shippingAddress.city" name="contactInfo.shippingAddress.city" type="text" value="city" maxlength="100"/></td> |
---|
43 | <td ><input id="contactInfo.shippingAddress.state" name="contactInfo.shippingAddress.state" type="text" value="state" maxlength="100"/></td> |
---|
44 | <td><input id="contactInfo.shippingAddress.addressZipCode" name="contactInfo.shippingAddress.addressZipCode" type="text" value="123456" maxlength="10"/> |
---|
45 | </td> |
---|
46 | |
---|
47 | </tr> |
---|
48 | </table> |
---|
49 | |
---|
50 | |
---|
51 | <p>try Ends here </p> |
---|
52 | <form> |
---|
53 | </body> |
---|
54 | </html> |
---|