Javascript Function not recognized onclick - javascript

I have a javascript function named formApprove() and am calling that function within html onclick on a button. For some reason the javascript function is not being recognized because firebug tells me that the forApprove is not a function. Below is the code in the head:
<script type="text/javascript">
function formApprove() {
var TheTextBox = document.getElementById("formApprove");
TheTextBox.value = 'true';
alert("hellp");
return true;
}
</script>
Below is the code in the body:
<input type="submit" name="approve" value="Approve Membership" onclick="formApprove()" />
Any help on this would be greatly appreciated.
Full Code:
<head>
<script type="text/javascript">
function nextPrevious(txtElement, btnElement) {
switch(btnElement.name) {
case 'increase':
var numrows = document.getElementById("numOfRows");
if (txtElement.value < Number(numrows.value)) {
txtElement.value++;
} else {
alert('You are alread at the end of the members');
return false;
}
break;
case 'decrease':
if(txtElement.value > 1) {
txtElement.value--;
} else {
alert('You are alread at the begining of the members');
return false;
}
break;
case 'goto':
alert(txtElement.value);
break;
default:
}
return true;
}
function approve() {
var TheTextBox = document.getElementById("formApprove");
TheTextBox.value = 'true';
alert("hellp");
return true;
}
function formChange() {
var TheTextBox = document.getElementById("formSubmit");
TheTextBox.value = 'true';
return true;
}
function deleteRecord() {
var answer = confirm ("Are you sure you want to delete record?");
if (answer) {
var TheTextBox = document.getElementById("formDelete");
TheTextBox.value = 'true';
return true;
} else {return false;}
}
</script>
</head>
<body>
<form name="members_view" method="POST" action="viewpending.php">
<br />
<div id="buttons">
<input type="submit" name="update" value="Update Record" onclick="formChange(this.form.elements['formSubmit'].value)" /> -
<input type="submit" name="decrease" value="Previous" onclick="nextPrevious(this.form.elements['record'], this)" /> -
<input type="submit" name="increase" value="Next" onclick="nextPrevious(this.form.elements['record'], this)" /> -
<input type="submit" name="delete" value="Delete Record" onclick="deleteRecord(this.form.elements['formSubmit'].value)" /> -
<input type="submit" name="approve" value="Approve Membership" onclick="approve()" />
</div>
</div>
<div id="leftcase">
<div class="label">First Name:</div><div class="input"><input size="40" type="text" name="FNAME" value="<?php echo $row['FNAME']; ?>" /></div>
<div class="label">Middle Name:</div><div class="input"><input size="40" type="text" name="MNAME" value="<?php echo $row['MNAME']; ?>" /></div>
<div class="label">Last Name:</div><div class="input"><input size="40" type="text" name="LNAME" value="<?php echo $row['LNAME']; ?>" /></div>
<div class="label">Full Name:</div><div class="input"><input size="40" type="text" name="FULL_NAME" value="<?php echo $row['FNAME'].' '.$row['MNAME'].' '.$row['LNAME']; ?>" /></div>
<div class="label">Nick Name:</div><div class="input"><input size="40" type="text" name="NNAME" value="<?php echo $row['NNAME']; ?>" /></div>
<div class="label">Spouse/Partner Name:</div><div class="input"><input size="40" type="text" name="H_COUNTRY" value="<?php echo $row['H_COUNTRY']; ?>" /></div>
<div class="label">Anniversary Date:</div><div class="input"><input size="40" type="text" name="B_ZIP" value="<?php echo $row['B_ZIP']; ?>" /></div>
<div class="label">Primary Email:</div><div class="input"><input size="40" type="text" name="EMAIL" value="<?php echo $row['EMAIL']; ?>" /></div>
<div class="label">Second Email:</div><div class="input"><input size="40" type="text" name="B_CITY" value="<?php echo $row['B_CITY']; ?>" /></div>
<div class="label">Home Street:</div><div class="input"><input size="40" type="text" name="H_STREET" value="<?php echo $row['H_STREET']; ?>" /></div>
<div class="label">Home City:</div><div class="input"><input size="40" type="text" name="H_CITY" value="<?php echo $row['H_CITY']; ?>" /></div>
<div class="label">Home State:</div><div class="input"><input size="40" type="text" name="H_STATE" value="<?php echo $row['H_STATE']; ?>" /></div>
<div class="label">Home Zip:</div><div class="input"><input size="40" type="text" name="H_ZIP" value="<?php echo $row['H_ZIP']; ?>" /></div>
<div class="label">Home Phone:</div><div class="input"><input size="40" type="text" name="H_PHONE" value="<?php echo $row['H_PHONE']; ?>" /></div>
<div class="label">Cell:</div><div class="input"><input size="40" type="text" name="H_CELL" value="<?php echo $row['H_CELL']; ?>" /></div>
<div class="label">Birth Date:</div><div class="input"><input size="40" type="text" name="H_WEB" value="<?php echo $row['H_WEB']; ?>" /></div>
<div class="label">Membership Exp:</div><div class="input"><input size="40" type="text" size="40" name="MEMBER_INFO" value="<?php echo $row['MEMBER_INFO']; ?>" /></div>
<div class="label">Retired Mil Info:</div><div class="input"><input size="40" type="text" name="B_STATE" value="<?php echo $row['B_STATE']; ?>" /></div>
<div class="label">1st tour from:</div><div class="input"><input size="40" type="text" name="B_COUNTRY" value="<?php echo $row['B_COUNTRY']; ?>" /></div>
<div class="label">1st tour Rank/Rate:</div><div class="input"><input size="40" type="text" name="B_WEB" value="<?php echo $row['B_WEB']; ?>" /></div>
<div class="label">1st tour cruise Book:</div><div class="input"><input size="40" type="text" name="B_PHONE" value="<?php echo $row['B_PHONE']; ?>" /></div>
<div class="label">2nd tour from:</div><div class="input"><input size="40" type="text" name="B_FAX" value="<?php echo $row['B_FAX']; ?>" /></div>
<div class="label">2nd tour Rank/Rate:</div><div class="input"><input size="40" type="text" name="PAGER" value="<?php echo $row['PAGER']; ?>" /></div>
<div class="label">2nd tour cruise Book:</div><div class="input"><input size="40" type="text" name="B_COMPANY" value="<?php echo $row['B_COMPANY']; ?>" /></div>
<div class="label">3rd tour from:</div><div class="input"><input size="40" type="text" name="B_TITLE" value="<?php echo $row['B_TITLE']; ?>" /></div>
<div class="label">3rd tour Rank/Rate:</div><div class="input"><input size="40" type="text" name="B_DEPT" value="<?php echo $row['B_DEPT']; ?>" /></div>
<div class="label">3rd tour cruise book:</div><div class="input"><input size="40" type="text" name="OFFICE_LOC" value="<?php echo $row['OFFICE_LOC']; ?>" /></div>
</div>
<div id="rightcase">
<div class="label">Biography:</div><div class="input"><textarea rows="35" cols="80" name="NOTES" /><?php echo $row['NOTES']; ?></textarea></div>
<input type="hidden" id="record" name="record" value="<?php echo $_POST['record']; ?>"/>
<input type="hidden" id="formSubmit" name="formSubmit" value="<?php echo $_POST['formSubmit']; ?>" />
<input type="hidden" id="formApprove" name="formApprove" value="<?php echo $_POST['formApprove']; ?>" />
<input type="hidden" id="formDelete" name="formDelete" value="<?php echo $_POST['formDelete']; ?>" />
<input type="hidden" id="numOfRows" name="numOfRows" value="<?php echo $num_rows; ?>" />
<input type="hidden" id="ID" name="ID" value="<?php echo $_POST['ID']; ?>"/>
</div>
<div id="buttons">
<input type="submit" name="update" value="Update Record" onclick="formChange(this.form.elements['formSubmit'].value)" > - <input type="submit" name="decrease" value="Previous" onclick="nextPrevious(this.form.elements['record'], this)" > - <input type="submit" name="increase" value="Next" onclick="nextPrevious(this.form.elements['record'], this)" > - <input type="submit" name="delete" value="Delete Record" onclick="deleteRecord(this.form.elements['formSubmit'].value)" >
</form>
</body>

You probably have a name clash with the function and the name of the element.
Either rename the function or rename the textbox.

Related

Validate all the inputs of a table in jquery

I have a set of inputs that are dynamically generated and their id's incremented based on the number of items in an array
<table width="100%">
<?php $i = 1; ?>
<?php foreach ($products as $product) { ?>
<tr>
<td>
<p><b><?php echo $product['name']; ?></b></p>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<div class="form-group">
<label class="control-label" for="firstname_<?php echo $i; ?>">First Name:</label>
<input name="firstname_<?php echo $i; ?>" id="firstname_<?php echo $i; ?>" required>
</div>
</td>
<td>
<div class="form-group">
<label class="control-label" for="lastname_<?php echo $i; ?>">Last Name:</label>
<input name="lastname_<?php echo $i; ?>" id="lastname_<?php echo $i; ?>" required>
</div>
</td>
<td>
<div class="form-group">
<label class="control-label" for="recipient_number_<?php echo $i; ?>"> Phone Number:</label>
<input name="recipient_number_<?php echo $i; ?>" id="recipient_number_<?php echo $i; ?>" required>
</div>
</td>
<td>
<div class="form-group">
<label class="control-label" for="recipient_email_<?php echo $i; ?>"> Email:</label>
<input name="recipient_number_<?php echo $i; ?>" id="recipient_email_<?php echo $i; ?>" required>
</div>
</td>
</tr>
<?php $i++; ?>
<?php } ?>
</table>
I am trying to look for a way using JQuery to loop through all the generated inputs to ensure they are not empty
Try this snippet.
This will allow you to validate the fields which are empty, and try to use the filter, that helps you to do it without any loop.
More information filter
$('#sender_container').on('submit',function(e)
{
e.preventDefault();
validate();
});
function validate()
{
$('#sender_container > input[type="text"]')
.removeClass('error')
.filter(function() {
// Remove error classes. Filter
return !$.trim(this.value);
})
.addClass('error');
}
.error {
border: 1px solid red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form method="post" id="sender_container">
<input type="text" name="name[]" />
<input type="text" name="name[]" />
<input type="text" name="name[]" />
<input type="text" name="name[]" />
<input type="text" name="name[]" />
<input type="submit" name="submit" />
</form>
try using this -
you can replace table with a table Id here - $('#tableId :input')
$('table :input').each(function(){
//Enter your code to validate input
console.log($(this).attr('name') + " : " + $(this).val());
});

php add data improperly into mysql

I added the data to mysql but its not true. There are a few lines manually duplicating data. Add and commands my update it still works.I don't understand why the data added to the unsatisfactory. Who can help me not? thanks
this is code html:
<form id="myform" method="post">
<div>
<div>
<div>
<!--dongggggggggggggggggg 2-->
<?php
$select = mysql_query("Select * from Salary where code='C'");
$resultmax = mysql_query("SELECT MAX(stt) AS max_page FROM Salary where code='C'");
$rowmax = mysql_fetch_array($resultmax);
while ($resultRow = mysql_fetch_array($select)) {
?>
<div class="row">
<div class="col-lg-12">
<input type="text" name="stt[]"
value="<?php echo $resultRow['stt'] ?>"
style="float:left; width:20px; border:none"
readonly/>
<input type="hidden" name="d[]" value="C"
style="float:left; width:20px; border:none"/>
<input id="dd" name="a[]" class="col-lg-35 a"
value="<?php echo $resultRow['col_a'] ?>"
type="text">
<input name="b[]" class="col-lg-35 a nhay"
value="<?php echo $resultRow['col_b'] ?>"
onblur="luu()" type="text">
<input name="c[]" class="col-lg-35 a"
value="<?php echo $resultRow['col_c'] ?>"
onblur="luu()" type="text">
<input name="check_save" class="col-lg-1" type="checkbox"
value="" onclick="return false;">
</div>
</div>
<?php } ?>
<div class="row">
<div class="col-lg-12">
<input type="hidden" name="d[]" value="C"
style="float:left; width:20px; border:none"/>
<input name="stt[]"
value="<?php echo $rowmax["max_page"] + 1 ?>"
style="float:left; width:20px;border:none" readonly/>
<input id="dd" name="a[]" class="col-lg-35 a" value=""
type="text">
<input name="b[]" class="col-lg-35 a"
onblur="luu()" value="" type="text">
<input name="c[]" class="col-lg-35 a"
onblur="luu()" value="" type="text">
<input id="save" name="check_save" class="col-lg-1 ab"
type="checkbox" value="" onclick="return false;">
</div>
</div>
<div class="row" id="c">
<div class="col-lg-12">
<input type="hidden" name="d[]" value="C"
style="float:left; width:20px; border:none"/>
<input name="stt[]" id="stt"
value="<?php echo $rowmax["max_page"] + 2 ?>"
style="float:left; width:20px;border:none" readonly/>
<input id="dd" name="a[]" class="col-lg-35 a" value=""
type="text" >
<input name="b[]" class="col-lg-35 a nhay"
onblur="luu()" value="" type="text">
<input name="c[]" class="col-lg-35 a"
onblur="luu()" value="" type="text">
<input id="save" name="check_save" class="col-lg-1 ab"
type="checkbox" value="" onclick="return false;">
</div>
</div>
<!--dongggggggggggggggggg 1-->
<br>
</div>
</div>
</div>
<div>
<di>
<div>
<!--dongggggggggggggggggg 1-->
<?php
$select = mysql_query("Select * from Salary where code='P'");
$resultmax = mysql_query("SELECT MAX(stt) AS max_page FROM Salary where code='P'");
$rowmax = mysql_fetch_array($resultmax);
while ($resultRow = mysql_fetch_array($select)) {
?>
<!--dongggggggggggggggggg 1-->
<!--dongggggggggggggggggg 2-->
<div class="row">
<div class="col-lg-12">
<input type="text" name="stt[]"
value="<?php echo $resultRow['stt'] ?>"
style="float:left; width:20px; border:none"
readonly/>
<input type="hidden" name="d[]" value="P"
style="float:left; width:20px; border:none"/>
<input id="dd" name="a[]" class="col-lg-35 a"
value="<?php echo $resultRow['col_a'] ?>"
type="text">
<input name="b[]" class="col-lg-35 a nhay"
value="<?php echo $resultRow['col_b'] ?>"
onblur="luu()" type="text">
<input name="c[]" class="col-lg-35 a"
value="<?php echo $resultRow['col_c'] ?>"
onblur="luu()" type="text">
<input name="check_save" class="col-lg-1" type="checkbox"
value="" onclick="return false;">
</div>
</div>
<?php } ?>
<div class="row">
<div class="col-lg-12">
<input type="hidden" name="d[]" value="P"
style="float:left; width:20px; border:none"/>
<input name="stt[]"
value="<?php echo $rowmax["max_page"] + 1 ?>"
style="float:left; width:20px;border:none" readonly/>
<input name="a[]" class="col-lg-35 a" value="" type="text">
<input name="b[]" class="col-lg-35 a" value="" onblur="luu()" type="text">
<input name="c[]" class="col-lg-35 a" value=""
onblur="luu()" type="text">
<input id="save" name="check_save" class="col-lg-1 ab" type="checkbox" value="" onclick="return false;">
</div>
</div>
<!--dongggggggggggggggggg 1-->
<!--dongggggggggggggggggg 2-->
<div class="row" id="d">
<div class="col-lg-12">
<input type="hidden" name="d[]" value="P" style="float:left; width:20px; border:none"/>
<input name="stt[]" value="<?php echo $rowmax["max_page"] + 2 ?>" style="float:left; width:20px;border:none" readonly/>
<input id="dd" name="a[]" class="col-lg-35 a" value="" type="text">
<input name="b[]" class="col-lg-35 a nhay" value="" onblur="luu()" type="text">
<input name="c[]" class="col-lg-35 a" value="" onblur="luu()" type="text">
<input id="save" name="check_save" class="col-lg-1 ab" type="checkbox" value="" onclick="return false;">
</div>
</div>
<!--dongggggggggggggggggg 1-->
<br>
</div>
</di>
</div>
</form>
this is javascript :
<script type="text/javascript" language="javascript">
function luu() {
$.ajax({
type: 'POST',
url: 'insert.php',
data: $('#myform').serialize(),
dataType: 'JSON',
success: function (data) {
check();
}
});
}
$(document).ready(function () {
var currentBoxNumber = 0;
$(document).on('keyup', '.a', function (e) {
if (e.keyCode == 13) {
textboxes = $("input.a");
currentBoxNumber = textboxes.index(this);
if (textboxes[currentBoxNumber + 1] != null) {
nextBox = textboxes[currentBoxNumber + 1];
if (nextBox.id == "dd") {
luu();
}
nextBox.focus();
return false;
}
}
});
var i = document.getElementById("stt").value;
$(document).on('keyup', '.nhay', function (e) {
if (e.keyCode == 13) {
$('.a').removeClass('nhay');
var y = parseInt(i) + parseInt(1);
$('#c').append('<div><input type="hidden" name="d[]" value="C" style="float:left; width:20px; border:none"/><input name="stt[]" value="' + y + '" style="float:left; width:20px;border:none" readonly/><input id="dd" name="a[]" class="col-lg-35 a" value="" type="text"><input name="b[]" onblur="luu()" class="col-lg-35 a nhay" value="" type="text"><input name="c[]" onblur="luu()" class="col-lg-35 a" value="" type="text" ><input id="save" name="check_save" class="col-lg-1 ab" type="checkbox" value="" onclick="return false;"></div>');
$('#d').append('<div><input type="hidden" name="d[]" value="P" style="float:left; width:20px; border:none"/><input name="stt[]" value="' + y + '" style="float:left; width:20px;border:none" readonly/><input id="dd" name="a[]" class="col-lg-35 a" value="" type="text"><input name="b[]" onblur="luu()" class="col-lg-35 a nhay" value="" type="text"><input name="c[]" onblur="luu()" class="col-lg-35 a" value="" type="text" ><input name="check_save" class="col-lg-1 ab" type="checkbox" value="" onclick="return false;"></div>');
i++;
}
});
});
<script>
function check() {
var myForm = document.forms.myform;
var myControls = $(myForm).find('input[name="a[]"]').filter(function () {
if (!$.trim(this.value)) {
$(this).siblings('.ab').prop('checked', false)
} else {
$(this).siblings('.ab').prop('checked', true)
}
});
}
this is insert.php :
$a=$_POST['a'];
$b=$_POST['b'];
$c=$_POST['c'];
$sott=$_POST['stt'];
$d=$_POST['d'];
$index=0;
foreach($a as $s){
$check="Select ID from Salary where stt='".$sott[$index]."' and code='".$d[$index]."'";
$result1 = mysql_query($check);
$myid = mysql_num_rows($result1);
if ($myid==null)
{
$sql = "INSERT INTO Salary(code,col_a,col_b,col_c,stt) VALUES('".$d[$index]."','$s','".$b[$index]."','".$c[$index]."','".$sott[$index]."')";
$result = mysql_query($sql);
}
else
{
$sql="Update Salary set col_a='$s',col_b='".$b[$index]."',col_c='".$c[$index]."' where stt='".$sott[$index]."' and code='".$d[$index]."'";
$result = mysql_query($sql);
}
$index++;
}
if ($result) { echo "1";}
this is output :

Auto form submission in cakephp page

I have a situation where I want to auto submit form in cakephp ctp file. Can anyone please help me? I know there are number of same or similar question have asked before this. It tried everything, but it doesn't work. Please have a look on my code:
SCRIPT PART:
<script>
window.onload = function() {
alert("reached here");
document.frmTransaction.submit();
}
</script>
HTML PART:
<form method="post" action="https://secure.ebs.in/pg/ma/sale/pay" name="frmTransaction" id="frmTransaction" onSubmit="return validate()" onLoad="javascript:autoSubmit();">
<input name="account_id" type="hidden" value="<?echo $_POST['account_id'] ?>" />
<input name="return_url" type="hidden" size="60" value="<?echo $_POST['return_url'] ?>" />
<input name="mode" type="hidden" size="60" value="<? echo $_POST['mode']?>" />
<table style="width:50%">
<tr>
<td>Reference: </td><td><input name="reference_no" type="text" value="<? echo $_POST['data']['reference_no'] ?>" readonly/></td>
</tr>
<tr>
<td>Amount: </td><td><input name="amount" type="text" value="<? echo $_POST['data']['amount'] ?>" readonly/>Rs.</td>
</tr>
</table>
<input name="description" type="hidden" value="<? echo $_POST['description'] ?>" />
<input name="name" type="hidden" value="<? echo $_POST['name'] ?>" />
<input name="email" type="hidden" value="<? echo $_POST['email'] ?>" />
<input name="phone" type="hidden" value="<? echo $_POST['phone'] ?>" />
<input name="address" type="hidden" value="<? echo $_POST['address'] ?>" />
<input name="country" type="hidden" value="IND" />
<input name="postal_code" type="hidden" value="<? echo $_POST['postal'] ?>" />
<input name="state" type="hidden" value="<? echo $_POST['state'] ?>" />
<input name="city" type="hidden" value="<? echo $_POST['city'] ?>" />
<input name="secure_hash" type="hidden" size="60" value="<? echo $secure_hash;?>" />
<br/><br/><br/><input name="submit" value="Submit" type="submit" id="submit" style="background:#ff6600;color:#fff;height:40px;width:150px;font-family:Calibri;font-size: 22px;"/>
</form>
You have to check form definition again.
Remove onload event statement.
<form method="post" action="https://secure.ebs.in/pg/ma/sale/pay" name="frmTransaction" id="frmTransaction" onSubmit="return validate()">

Using window.onload to submit a form

I am trying to submit a form when the page loads. I have tried quite a few different things and none of them seem to work. If I use
window.onload = function(){
alert("test");
}
It works fine but when I try to use
window.onload = function(){
console.log($("#testForm")[0].submit)​, 2000);
}
or
window.onload = function(){
document.getElementById("testForm").submit();
}
It no longer works.
JS:
window.onload = function(){
document.getElementById("testForm").submit();
}
HTML:
<form name="testForm" id="testForm" method="POST" action="test.php">
<input name="MERGE1" type="text" id="fname" size="40" maxlength="40" value="<?php echo $fname; ?>" />
<input name="MERGE2" type="text" id="lname" size="40" maxlength="40" value="<?php echo $lname; ?>" />
<input name="MERGE0" type="text" id="email" size="40" maxlength="40" value="<?php echo $email; ?>" />
<input name="MERGE3" type="text" id="company" size="40" maxlength="40" value="<?php echo $company; ?>" />
<input name="MERGE6" type="text" id="phone" size="40" maxlength="40" value="<?php echo $phone; ?>" />
<input name="MERGE19" type="text" id="city" size="40" maxlength="40" value="<?php echo $city; ?>" />
<input name="Continue" type="submit" value="Continue" />
</form>
Try this:
$("#testForm").submit()
I replaced the POST with a GET and the action with a working URL so you can see something happening.
Working fiddle

Launch new modal from a previous modal

Is it possible to launch a new modal when I click the submit button from a previous modal? I've been trying to do this all day and I'm stuck. I'm using CodeIgniter. I've tried to add another function in my onclick but it's not working.
Here's the button that triggers my modal:
<span class="btn btn-primary">Create</span>
And this is my modal:
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Property Management</h3>
</div>
<div class="modal-body">
<form class="form-horizontal" name="propertymgt-form" id="propertymgt-form" action="<?php echo $this->config->item('8L_URL')."/propertymgt/post/".$form_action; ?>" method="POST">
<br />
<div class="control-group">
<label class="control-label" for="title">Title:</label>
<div class="controls" style="margin-bottom:15px;">
<input type="text" id="title" placeholder="Title" name="title" class="span5" value="<?php echo $title; ?>">
</div>
<label class="control-label" for="fullname">Fullname:</label>
<div class="controls" style="margin-bottom:15px;">
<input type="text" id="lastname" placeholder="Lastname" name="lastname" class="span3" value="<?php echo $lastname; ?>">
<input type="text" id="firstname" placeholder="Firstname" name="firstname" class="span3" value="<?php echo $firstname; ?>">
<input type="text" id="middlename" placeholder="Middlename" name="middlename" class="span3" value="<?php echo $middlename; ?>">
</div>
<label class="control-label" for="address">Address:</label>
<div class="controls" style="margin-bottom:15px;">
<input type="text" name="address" class="span3" id="address" placeholder="No., Street, Building" value="<?php echo $address; ?>">
<input type="text" name="city" class="span3" id="city" placeholder="City" value="<?php echo $city; ?>">
<input type="text"name="province" class="span3" id="province" placeholder="Province" value="<?php echo $province; ?>">
</div>
</div>
<input type="hidden"name="uuid" class="span3" id="uuid" value="<?php echo $id; ?>">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="registration-submit" onClick="submitForm('propertymgt-form');loadModuleForm('<?php echo $this->config->item('8L_URL')."/propertymgt/form/add"; ?>');">Submit</button>
<button type="button" data-dismiss="modal" class="btn">Close</button>
</div>
The loadmoduleform() should load my new modal. Am I missing something? I need somebody's help. Thanks!
u want something like this?
demo
u just need to hide 1st modal n launch another modal on ur button click function
$('#newModal1').modal('hide');
$('#newModal2').modal('show');
I just called the script for my function loadmoduleForm(). All I have to do now is to call for a function where loadmoduleForm() is inside. Thanks anyway. :)

Categories

Resources