www.webdeveloper.com
Results 1 to 5 of 5

Thread: data trasfer

  1. #1
    Join Date
    Oct 2012
    Location
    istanbul
    Posts
    61

    data trasfer

    Hello,

    Sorry, I do not speak English

    I have a question

    Code:
    <input type="checkbox" name="dvr" id="dvr" value="yes" onclick="return showHideDvr();" />
    This using checkbox
    checkbox is not selected = return kontrol_one();
    checkbox is selected = return kontrol_two();

    <form method="POST" action="xxx.php" onsubmit="-HERE-">

    Can you help?

    Regards

  2. #2
    Join Date
    Jul 2013
    Posts
    66
    I am not entirely sure I understand you right. Is this what you're looking for?

    Code:
    <form method="POST" action="xxx.php" onsubmit="getSubmitFunction()">
    And the corresponding javascript part

    Code:
    function getSubmitFunction() {
        return document.getElementById('dvr').checked ? kontrol_two() : kontrol_one();
    }

  3. #3
    Join Date
    Oct 2012
    Location
    istanbul
    Posts
    61
    Thanks for the reply

    but, control is making a form page and immediately continues

  4. #4
    Join Date
    Jul 2013
    Posts
    66
    Change the form definition to

    Code:
    <form method="POST" action="xxx.php" onsubmit="return getSubmitFunction();">
    Now, if you want to prevent the form from being submitted, kontrol_one and kontrol_two need to return false. If they return true, the form will be submitted.

  5. #5
    Join Date
    Oct 2012
    Location
    istanbul
    Posts
    61
    Now okay, thank you very much

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles