I am going mad........because of this error.....
I have done a simple coding........i am getting this error....
solution may be very simple,,,but i dont know..........can any body help me........
I am writing a function for onchange event in a drop down box, this is saying error.
html code:
[HTML] <tr>
<td>Number Of Bedrooms</td>
<td><select name=bedroom onchange="PopulateTextBox(this);">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
</select>
</tr>
[/HTML]
Javascript code
Expand|Select|Wrap|Line Numbers
- <SCRIPT LANGUAGE="JavaScript">
- function IsNumeric(strString)
- // check for valid numeric strings
- {
- var strValidChars = "0123456789";
- var strChar;
- var blnResult = true;
- if (strString.length == 0) return false;
- // test strString consists of valid characters listed above
- for (i = 0; i < strString.length && blnResult == true; i++)
- {
- strChar = strString.charAt(i);
- if (strValidChars.indexOf(strChar) == -1)
- {
- blnResult = false;
- }
- }
- return blnResult;
- }
- function validate()
- {
- var str = document.propertyadd.reference_no.value;
- var return_val = IsNumeric(str)
- if(return_val == false)
- {
- alert("Reference No. not a numeric");
- return false;
- }
- else
- {
- return;
- }
- }
- function PopulateTextBox(get_obj)
- {
- //int get_obj = document.proprtyadd.bedroom_no.value;
- alert(get_obj);
- for (int i=get_obj;i>0;i-- )
- {
- document.write("<tr><td>check here </td></tr>");
- }
- }
- </SCRIPT>