Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    India
    Posts
    135

    Unanswered: Passing the HIDDEN Value

    Hi

    How to pass the HIDDEN value to another page by submit the form.

    My scenario, while clicking an IMAGE HREF Link the hidden value should pass to the action page.? I was tried but, am not get the result

    any one help me!

    Thanx in advance.

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Passing the HIDDEN Value

    Originally posted by Saravanan.R
    Hi

    How to pass the HIDDEN value to another page by submit the form.

    My scenario, while clicking an IMAGE HREF Link the hidden value should pass to the action page.? I was tried but, am not get the result

    any one help me!

    Thanx in advance.
    PHP Code:
    <form action="action.php" method=post>
    <
    input type="hidden" name="hiddenparam" value="some value">
    <
    input type="image" name="submit" src="button.gif">
    </
    form
    or second solution:

    PHP Code:
    <form action="action.php" name="myform" method=post>
    <
    input type="hidden" name="hiddenparam" value="some value">

    <
    a href="javascript:document.myform.submit();">
    <
    img name="submit" border="0" src="button.gif">
    </
    a>

    </
    form

  3. #3
    Join Date
    Feb 2004
    Location
    India
    Posts
    135
    thanx for your reply. I will try out these solution.

    But My Scenario:

    I have two Image Hyper LINK one is Feedback & Information Link(not a INPUT TYPE="IMAGE"). while am clicking the Image Link, according to that Image I have to assign the values according to the clicked link, If I clicked the FEEDBACK Link i have to assign the hiddenparam as "FeedBack" else Information Link clicked hiddenparam as "Info" and pass to the action page.

    I was used javascript to send the VALUE onClick EVENT. While the link clicked my function FormSubmit(this.name) executed. Here the Image i want to pass Image name as argument.

    the following function is fired when the Image Link clicked:

    function FormSubmit(this)
    {
    document.cool.MailType.value= this.value
    document.cool.action = "<filename.php>"
    return true;
    }

  4. #4
    Join Date
    Feb 2004
    Location
    India
    Posts
    135
    Hi all,

    My Code:

    HTML
    ------

    <table> <tr><td>
    <form method="post" name="cool"><a href="index.php" imgsrc=="home.gif" border="0" </a><input type="image" name="MailType" value="Feedback" src="contact.gif" border="0" onClick="showWebmail(this.form);"><input type="image" name="MailTypes" value="Info" src="info.gif" border="0"></form></td></tr><table>

    Function showWebmail:
    ---------------------------

    function showWebmail(form) {

    $types = form.value ;

    if ( $types == "Feedback") {
    document.cool.MailType.value = "Feedback" ;
    }

    if ( $types == "Info" ) {
    document.cool.MailType.value);
    document.cool.submit() = "coolmail.php" ;
    }
    return true;
    }

    In the above HTML code, i have only two link without submit button. while clicking that image button according the value of button i have to assign value to the MailType value. But I can't get result.

    help me. or anyother solution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •