Loading ...
Sorry, an error occurred while loading the content.

Wrong YUI method Getting called

Expand Messages
  • umeshawasthi_80
    HI All, i have a user registration form where i am using YUI to check if some information provided by user is unique or not like his userID and his unique
    Message 1 of 3 , Feb 4, 2009
    • 0 Attachment
      HI All,

      i have a user registration form where i am using YUI to check if some
      information provided by user is unique or not like his userID and his
      unique identification number.

      i have attached the onChange even with the two text box and here is my
      YUI call to serverscript i have written this YUI code in seperate file
      and have included it in my jspp page

      function checkTinNumber(){

      document.getElementById("indicator1").style.display="";
      document.getElementById('registration').action="VerifyTinNumber.action";
      var
      tinNumber=document.getElementById("customerBusinessInformationPO.tinNumber").value;
      var formObject = document.getElementById('registration');
      YAHOO.util.Connect.setForm(formObject);
      var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback);

      }


      // Calling to Server

      var handleSuccess = function(o){

      if(o.responseText !== undefined){

      //alert("success");
      if(o.responseText=="SUCCESS"){


      }
      else if(o.responseText=="FAIL"){

      }
      }
      };

      var handleFailure = function(o){


      if(o.responseText !== undefined){
      //alert("fail");
      }
      };

      var callback =
      {
      success:handleSuccess,
      failure:handleFailure,
      argument:['foo','bar']
      };

      var sUrl = "VerifyTinNumber.action";

      similrary i have second function declarede here

      function checkLoginID(){
      document.getElementById("indicator2").style.display="";
      document.getElementById('registration').action="VerifyUserID.action";
      //var
      tinNumber=document.getElementById("customerBusinessInformationPO.tinNumber").value;
      alert("hulaaaaaaaaaaa");
      var formObject = document.getElementById('registration');
      YAHOO.util.Connect.setForm(formObject);
      var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback);

      }

      var callback =
      {
      success:handleSuccess,
      failure:handleFailure,
      argument:['foo','bar']
      };

      var sUrl = "VerifyUserID.action";

      my problem is YUI is all the time calling only my second function i'e
      checkLoginID()

      do any one have any idea why its doing this??

      thanks in advance,
      umesh
    • umeshawasthi_80
      DO any one suggest me where i am doing wrong???? ... document.getElementById( registration ).action= VerifyTinNumber.action ; ...
      Message 2 of 3 , Feb 5, 2009
      • 0 Attachment
        DO any one suggest me where i am doing wrong????

        --- In ydn-javascript@yahoogroups.com, "umeshawasthi_80"
        <umeshawasthi_80@...> wrote:
        >
        > HI All,
        >
        > i have a user registration form where i am using YUI to check if some
        > information provided by user is unique or not like his userID and his
        > unique identification number.
        >
        > i have attached the onChange even with the two text box and here is my
        > YUI call to serverscript i have written this YUI code in seperate file
        > and have included it in my jspp page
        >
        > function checkTinNumber(){
        >
        > document.getElementById("indicator1").style.display="";
        >
        document.getElementById('registration').action="VerifyTinNumber.action";
        > var
        >
        tinNumber=document.getElementById("customerBusinessInformationPO.tinNumber").value;
        > var formObject = document.getElementById('registration');
        > YAHOO.util.Connect.setForm(formObject);
        > var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback);
        >
        > }
        >
        >
        > // Calling to Server
        >
        > var handleSuccess = function(o){
        >
        > if(o.responseText !== undefined){
        >
        > //alert("success");
        > if(o.responseText=="SUCCESS"){
        >
        >
        > }
        > else if(o.responseText=="FAIL"){
        >
        > }
        > }
        > };
        >
        > var handleFailure = function(o){
        >
        >
        > if(o.responseText !== undefined){
        > //alert("fail");
        > }
        > };
        >
        > var callback =
        > {
        > success:handleSuccess,
        > failure:handleFailure,
        > argument:['foo','bar']
        > };
        >
        > var sUrl = "VerifyTinNumber.action";
        >
        > similrary i have second function declarede here
        >
        > function checkLoginID(){
        > document.getElementById("indicator2").style.display="";
        > document.getElementById('registration').action="VerifyUserID.action";
        > //var
        >
        tinNumber=document.getElementById("customerBusinessInformationPO.tinNumber").value;
        > alert("hulaaaaaaaaaaa");
        > var formObject = document.getElementById('registration');
        > YAHOO.util.Connect.setForm(formObject);
        > var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback);
        >
        > }
        >
        > var callback =
        > {
        > success:handleSuccess,
        > failure:handleFailure,
        > argument:['foo','bar']
        > };
        >
        > var sUrl = "VerifyUserID.action";
        >
        > my problem is YUI is all the time calling only my second function i'e
        > checkLoginID()
        >
        > do any one have any idea why its doing this??
        >
        > thanks in advance,
        > umesh
        >
      • umeshawasthi_80
        sorry problem got solved i was doing a silly mistkae and was expecting YUI to correct my mistake ...
        Message 3 of 3 , Feb 5, 2009
        • 0 Attachment
          sorry problem got solved i was doing a silly mistkae and was expecting
          YUI to correct my mistake
          --- In ydn-javascript@yahoogroups.com, "umeshawasthi_80"
          <umeshawasthi_80@...> wrote:
          >
          > HI All,
          >
          > i have a user registration form where i am using YUI to check if some
          > information provided by user is unique or not like his userID and his
          > unique identification number.
          >
          > i have attached the onChange even with the two text box and here is my
          > YUI call to serverscript i have written this YUI code in seperate file
          > and have included it in my jspp page
          >
          > function checkTinNumber(){
          >
          > document.getElementById("indicator1").style.display="";
          >
          document.getElementById('registration').action="VerifyTinNumber.action";
          > var
          >
          tinNumber=document.getElementById("customerBusinessInformationPO.tinNumber").value;
          > var formObject = document.getElementById('registration');
          > YAHOO.util.Connect.setForm(formObject);
          > var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback);
          >
          > }
          >
          >
          > // Calling to Server
          >
          > var handleSuccess = function(o){
          >
          > if(o.responseText !== undefined){
          >
          > //alert("success");
          > if(o.responseText=="SUCCESS"){
          >
          >
          > }
          > else if(o.responseText=="FAIL"){
          >
          > }
          > }
          > };
          >
          > var handleFailure = function(o){
          >
          >
          > if(o.responseText !== undefined){
          > //alert("fail");
          > }
          > };
          >
          > var callback =
          > {
          > success:handleSuccess,
          > failure:handleFailure,
          > argument:['foo','bar']
          > };
          >
          > var sUrl = "VerifyTinNumber.action";
          >
          > similrary i have second function declarede here
          >
          > function checkLoginID(){
          > document.getElementById("indicator2").style.display="";
          > document.getElementById('registration').action="VerifyUserID.action";
          > //var
          >
          tinNumber=document.getElementById("customerBusinessInformationPO.tinNumber").value;
          > alert("hulaaaaaaaaaaa");
          > var formObject = document.getElementById('registration');
          > YAHOO.util.Connect.setForm(formObject);
          > var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback);
          >
          > }
          >
          > var callback =
          > {
          > success:handleSuccess,
          > failure:handleFailure,
          > argument:['foo','bar']
          > };
          >
          > var sUrl = "VerifyUserID.action";
          >
          > my problem is YUI is all the time calling only my second function i'e
          > checkLoginID()
          >
          > do any one have any idea why its doing this??
          >
          > thanks in advance,
          > umesh
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.