02-25-2009, 07:12 PM
Hello Everyone,
In my web page, I have an Input field(button) with event (onclick) calling a javascript function.
This javascript checks if any mandatory field (like text input for name) is not filled.
My Problem : When I made a record, if I left blank mandatory field, and click on Button, the event is not recorded.
Remark : If I enter value in mandatory field, it’s OK.
//My input fields
any suggestions??
Why QTP is not picking up above written Javascript?
In my web page, I have an Input field(button) with event (onclick) calling a javascript function.
This javascript checks if any mandatory field (like text input for name) is not filled.
My Problem : When I made a record, if I left blank mandatory field, and click on Button, the event is not recorded.
Remark : If I enter value in mandatory field, it’s OK.
//My input fields
Code:
<input type="text" runat="server" id="name">
<input type="button" name="submit" onclick="jcpAction();">
//My javascript
function cpAction()
{
var success =true;
var nameinput = document.getElementById('name');
if(nameinput.value== '')
{
success = false;
}
return success;
}
any suggestions??
Why QTP is not picking up above written Javascript?