CodeIgniter Forums
Issue With Onclick Function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Issue With Onclick Function (/showthread.php?tid=64934)



Issue With Onclick Function - RK Info - 04-13-2016

Hey There !

I Am Working On Codeigniter..i have a issue with onclick function on Form_Submit button

Here is my Code
Code:
$attributes = array('class' => 'form-horizontal', 'id' => 'form_tax','onsubmit' => 'return DisplayMessages()');

echo form_open_multipart('Tax', $attributes,$hidden);

echo form_submit('tax', 'Save & Continue',"class='btn-lg-blk btn-orange'");
<input type = "hidden" value = "These fields Are pending To Save" id="printmsg">
i want to do something like,when i click on submit button form should be submitted and at the same time message should print on the top of the page that "These Fields Are Pending To save"... it means when click on submit it checks which fields are blank and print the message and rest fields should be submitted.and i want to do it without Validation

Here is my function Which i have defined in Form_open

Code:
function DisplayMessages()
{
    //alert ("display message");        
    /*var Birth_number = $('#Birth_Certificate_number').val();
    var Date_Expires = $('#DL_Expires').val();*/
    var Tax_File = $('#tax_file').val();
    
     if(Tax_File =="")
    {
        //alert ("test");
        document.getElementById("printmsg").value = "These Fields Are Pending To Save";
    }


}

in above code, function can call, i can alert it  but message can't print
do not no where is the mistake?

Any Help Please?