I can't get Form name - form name pass to hyperlink

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepikashalini
    New Member
    • Mar 2008
    • 18

    #1

    I can't get Form name - form name pass to hyperlink

    Hi,

    i use one function i can't get formname in alert message box. pls replay soon

    [code=javascript] for(var i=0,j=0;i<Selec tedMagazines.le ngth;i++)
    {
    if(item.name==S electedMagazine s[i].name)
    {
    var price="";
    var newhtml='<form name="frmLogin" action="login" method="post">' ;
    newhtml +='<table width="200" height="30" class="PageText " border="1"><tr> <td>'
    newhtml +='<input type="radio" id="rdSingleIss ue" name="reason" value="rdSingle Issue"/> Single Issue Price </td><td align="right">' +SelectedMagazi nes[i].price+' </td></tr><tr><td>';
    newhtml +='<input type="radio" id="rd12Issue" name="reason" value="rd12Issu e"/> 12 Issue Price </td><td align="right">' +SelectedMagazi nes[i].Issue12+' </td></tr><tr><td>';
    alert("From " +newhtml);
    alert(this.form );
    newhtml+='<cent er><div id ="SingleDisplay Buy"><a href="javascrip t:Magazinecheck buy('+item.id+' ,'+isCollection +',this.form)"> <img src="images/bt_buy.gif" align="middle" alt="" width="60" height="20" vspace="5" border="0"></a></div></center></td></tr></table></form></td>';
    }
    }[/code]
    Last edited by acoder; Apr 5 '08, 12:53 PM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    If you mean line 11, use the name property, i.e. this.form.name.

    PS. use [code] tags when posting code.

    Comment

    • deepikashalini
      New Member
      • Mar 2008
      • 18

      #3
      Originally posted by acoder
      If you mean line 11, use the name property, i.e. this.form.name.

      PS. use [code] tags when posting code.

      Hi,

      i can't get form name then how can i use this.form.name
      in above my code im not able pass this.form in other function.
      what mistake i done.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Can you explain what you're trying to do?

        Do you mean in the function Magazinecheckbu y()?

        Comment

        • deepikashalini
          New Member
          • Mar 2008
          • 18

          #5
          form name pass to Hyperlink

          hi,

          How to pass the form name to hyperlink. its possible.

          1.html += "<form name='frmReader ' method='post' action = 'DownloadReader '>";
          2.html += '<ul><li><a href="javascrip t:Download(this .form)">Reader Download</a></li></ul></span></ul><br></form>';

          i can't get the form name.

          Comment

          • pronerd
            Recognized Expert Contributor
            • Nov 2006
            • 392

            #6
            Without more details, and the code from the function method I can not say for sure since I am not clear on what you want to do. If you just want to pass the form's name to the download() function then you can change the function call to be something like this.

            Code:
            <a href="javascript:Download(this.form[B].name[/B])">

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              Double-posted threads merged.

              Please do not double post your questions. Keep all posts relating to one problem in a single thread.

              Moderator.

              Comment

              Working...