function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MFSDevMFSDev 

Error b is undefined in JS remoting file

 

Requirement: We need to send some data from HTML input fields to Apex.
We have used JS remoting method to acheive this.
In a VF page, we have html input field. Submit button call a JS function which executes Remote method of Apex.
It is working well .
Problem we are facing is that we have a container VF page, through which we display dynamic content for page.
And page shows at site level.
Now, while same html input fields we are adding in container VF and submit button on click is calling javascript, then Remote action is not executing.


Error: TypeError: b is undefined
Source File: http://p-united-developer-edition.ap1.force.com/jslibrary/1351189248000/sfdc/VFRemote.js
Line: 118

Our HTML:
<form class="cmxform" id="signUpForm" >
<fieldset class="ui-widget ui-widget-content ui-corner-all">
<legend class="ui-widget ui-widget-header ui-corner-all">Please provide your information in the form below to sign up</legend>
<p>
<label>Firstname</label>
<input name="Firstname" id="Fname" type="text" maxlegth="15" size="60" />
</p>
<p>
<label>Last Name</label>
<input name="Lastname" id="Lname" type="text" size="60" />
</p>
<p>
<input type="button" onClick="signUp();" value="Submit" class="button" />

</p>
</fieldset>
</form>


JS remote script:

function signUp()
{
alert("MFS");
var firstName = document.getElementById('Fname').value;
var lastName = document.getElementById('Lname').value;

alert("MFS : "+firstName+"::"+lastName);
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.MyController.myMethod}',
firstName,lastName,
function(result, event){
alert("MFS function called"+event.status);
if (event.status) {
alert("MFS event.status"+event.status);
} else if (event.type == 'exception') {
alert("MFS exception: "+event.message+event.where);

} else {
alert("MFS else ");
}
},
{escape: true}
);
}
</script>

Lex Gen25Lex Gen25

What did you do to solve this? I'm getting the exact same error, same file, same line.

ameghamegh

I also get the same error

Satyendra RawatSatyendra Rawat
Hi
Clear the cache and history of browser or change the browser.
and one more time walk-through your remote method.