help me with this code please

Discussion in 'Programming' started by pravvish, Jun 23, 2008.

  1. #1
    i have a simple html page with a combobox and a label and submit button in a html form ..

    i need to:
    1. check whether both combobox and text have been input .if yes then submit.
    2.display these values in another page as text :(:(:(

    can any one please help me with the code?
     
    pravvish, Jun 23, 2008 IP
  2. pravvish

    pravvish Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    and i need to use just javascript without any cookies if possible ...
     
    pravvish, Jun 23, 2008 IP
  3. krdzal

    krdzal Peon

    Messages:
    105
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    In the php file (that gets the variables form the form) create some function for checking those variables.
    example
    if(empty($checkbox1) || empty($checkbox2))
    /*Prompt error for empty checkboxes*/
    else
    /*do whatever you want*/
     
    krdzal, Jun 24, 2008 IP
  4. aksClass

    aksClass Member

    Messages:
    29
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #4
    use the following javascript to validate on client side:

    <script language="javascript">
        fnSubmit()
        {
            var combobox1 = document.getElementById("ID OF YOUR combobox");
            var text1 = document.getElementById("ID OF YOUR textbox");
            
            if (combobox1.value !="" && text1.value !="")  
            {
                 return true;// submits the form
            } 
    		else
    		{
    			alert("please fill all required fienld");
    			return false;
    		}
        }  
    </script>
    Code (markup):
    please rep me if you like this.
     
    aksClass, Jun 24, 2008 IP
    Teelo likes this.
  5. pravvish

    pravvish Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thank you ...

    i wanted to get the variables from the first html form in the second one ....

    i sent the data using get method ...
    i want to display the values as links in the next page .. which links to other websites....

    can any one hepl me with that..
     
    pravvish, Jun 24, 2008 IP
  6. pravvish

    pravvish Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i solved it myself ... thanks guys for the help...:D:D
     
    pravvish, Jun 25, 2008 IP