Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Need to reset form fields


I need to reset my form fields. I had achived this previously when my fields were normal "input" type fields.

But I am unable to do so after I changed my fields to the hbj:input types.

I have written the following code:

function resetFields(){

alert("inside reset");

var funName = htmlb_formid+"_getHtmlbElementId";

fun = window[funName];

var inputField1 = eval(fun("contFnameField"));

var inputString1 = inputField1.getValue().toString();

if(inputString1 !=null)





This gives me an error.

How can I achieve this?

Also I have a text area in my form. So I cannot specify "jsObjectneeded = true" for this textarea field of mine. How can i perform validations on this field before form submit.

I have one more query-- I find that when I click on submit button on the page, It does not invoke the associated controller.

The button code is -

<hbj:button							id = "Contactus"
	text = "SUBMIT" 
	disabled = "false" 	
	onClientClick="validateFields()"			onClick = "SendMail"	

I find that validateFields() is invoked, but SendMail() in my controller is not invoked.

Please give me your views on this.


Former Member
Not what you were looking for? View more on this topic or Ask a question