how to write ckeditor code in laravel form view in laravel - laravel

Hello everyone i want to add ckeditor in my view which has multiple divs. How can i do that by adding this ckeditor code:
<title>A Simple Page with CKEditor</title>
<script src="../ckeditor.js"></script>
</head>
<body>
<form>
<textarea name="editor1" id="editor1" rows="10" cols="80">
This is my textarea to be replaced with CKEditor.
</textarea>
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'editor1' );
</script>
</form>
</body>
And this is my view
#extends('sadmin.main-template')
#section('title', 'Super admin Dashboard')
#section('title', 'Add Plan')
#section('content')
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 right-sidebar admin-client add-client">
#include('partials.errors')
<form action="{{url('sadmin/add_plan')}}" class="toggle-disabled" method="post">
{!! csrf_field() !!}
<h3 class="title">Add a plan</h3>
<div class="form-group">
<label >You Can Create Your Plan Here</label>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 left-client-title">
<div class="form-group">
<label class="form-label name">
<span class="form-name">Name</span>
<input type="text" class="form-control" id="name" name="name" placeholder="" data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$">
</label>
</div>
<div class="form-group">
<label class="form-label name">
<span class="form-name">Price</span>
<input type="text" class="form-control" id="name" name="price" placeholder="" data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$">
</label>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 right-client-title">
<div class="form-group">
<label class="form-label name">
<span class="form-name">Allowed Users</span>
<input type="text" class="form-control" id="name" name="allowed_users" placeholder="" data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$">
</label>
</div>
<div class="form-group">
<label class="form-label name">
<span class="form-name">Can Trail</span>
<input type="text" class="form-control" id="canTrail" name="can_trail" placeholder="" data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$">
</label>
</div>
</div>
<div class="form-group">
<label class="form-label name">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 left-client-title">
<span class="form-name">Trail Duration</span>
<input type="text" class="form-control" id="password" name="trail_duration" placeholder="" data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$">
</label>
<div class="form-group">
<label class="form-label name">
<span class="form-name">Detail 1</span>
<input type="text" class="form-control" id="passwordConfirmation" name="detail1" placeholder="" data-validation="custom" data-validation="required">
</label>
</div>
</div>
<div class="form-group">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 right-client-title">
<label class="form-label name">
<span class="form-name">Detail 2</span>
<input type="text" class="form-control" id="phoneNumber" name="detail2" placeholder="" data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$">
</label>
<div class="form-group">
<label class="form-label name">
<span class="form-name">Staff Profiles</span>
<input type="text" class="form-control" id="planName" name="staff_profiles" placeholder="" data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$">
</label>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 left-client-title">
<div class="form-group">
<label class="form-label name">
<span class="form-name">Space Management</span>
<input type="text" class="form-control" id="planPrice" name="space_management" placeholder="" data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$">
</label>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 right-client-title">
<div class="form-group">
<label class="form-label name">
<span class="form-name">Currency Unit</span>
<input type="text" class="form-control" id="allowedUsers" name="currency_unit" placeholder=""data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$" >
</label>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 right-client-title">
<div class="form-group">
<label class="form-label name">
<span class="form-name">Location charges</span>
<input type="text" class="form-control" id="allowedUsers" name="location_charges" placeholder=""data-validation="custom" data-validation-regexp="^([A-Za-z ]+)$" >
</label>
</div>
</div>
</div>
<p> </p>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
<div align="center">
<button type="submit" class="btn btn-success" style="padding-left:90px; padding-right:90px;"><strong>Submit</strong></button>
</div>
</div>
</div>
</section>
</div>
#endsection
How i can apply ckeditor code in each div any help would be appreciated.

Related

PHP Laravel Post action

I have a form page for users informations update but my post function isn't working.I have defined a post method in the blade page and I show the page as a formaction post.This is my code;
#extends('layouts.admin-master')
#section('content')
<form action="post">
<div class="form-row">
<div class="form-group">
<label for="inputAddress2">Ad Soyad</label>
<input type="text" class="form-control" id="inputAddress2" name="name" value="{{ Auth::user()->name }}">
</div>
<br><br>
<div class="form-group">
<label for="inputAddress2">Şirket</label>
<input type="text" class="form-control" id="inputAddress2" name="company">
</div>
</div>
<div class="form-group">
<label for="inputAddress">Email</label>
<input type="text" class="form-control" id="inputAddress" name="email" value="{{ Auth::user()->email }}">
</div>
<div class="form-group">
<label for="inputAddress2">Telefon</label>
<input type="text" class="form-control" id="inputAddress2" name="phone">
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="inputState">Üyelik Tipi</label>
<select id="inputState" class="form-control">
<option selected>Seçenekler</option>
<option>Bronz Üyelik</option>
<option>Silver Üyelik</option>
<option>Gold Üyelik</option>
</select>
</div>
<div class="form-group col-md-2">
<label class="radio-container m-r-55">Tedarikçi
<input type="radio" checked="checked" name="secim" value="tedarikci">
<span class="checkmark"></span>
</label>
`enter code here` <label class="radio-container">Alıcı
<input type="radio" name="secim" value="alici">
<span class="checkmark"></span>
</label>
</div>
</div>
<form action="{{route('form.add')}}" method="post" enctype="multipart/form-data">
<button type="submit" class="btn btn-primary">Kaydet</button>
</form>
</form>
#endsection
try this:
#extends('layouts.admin-master')
#section('content')
<form action="{{route('form.add')}}" method="post" enctype="multipart/form-data">
<div class="form-row">
<div class="form-group">
<label for="inputAddress2">Ad Soyad</label>
<input type="text" class="form-control" id="inputAddress2" name="name" value="{{ Auth::user()->name }}">
</div>
<br><br>
<div class="form-group">
<label for="inputAddress2">Şirket</label>
<input type="text" class="form-control" id="inputAddress2" name="company">
</div>
</div>
<div class="form-group">
<label for="inputAddress">Email</label>
<input type="text" class="form-control" id="inputAddress" name="email" value="{{ Auth::user()->email }}">
</div>
<div class="form-group">
<label for="inputAddress2">Telefon</label>
<input type="text" class="form-control" id="inputAddress2" name="phone">
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="inputState">Üyelik Tipi</label>
<select id="inputState" class="form-control">
<option selected>Seçenekler</option>
<option>Bronz Üyelik</option>
<option>Silver Üyelik</option>
<option>Gold Üyelik</option>
</select>
</div>
<div class="form-group col-md-2">
<label class="radio-container m-r-55">Tedarikçi
<input type="radio" checked="checked" name="secim" value="tedarikci">
<span class="checkmark"></span>
</label>
`enter code here` <label class="radio-container">Alıcı
<input type="radio" name="secim" value="alici">
<span class="checkmark"></span>
</label>
</div>
</div>
<button type="submit" class="btn btn-primary">Kaydet</button>
</form>
put this line in your form and it should work :
{{csrf_field()}}
and make sure that your route address is correct too
u can add #csrf above the button

I keep getting an Integrity constraint violation when I'm trying to submit data to db

I have this problem and I have no idea why it's not working. I have tried so many code changes but I still get the same error when I try to submit a form. It's a simple form to insert data to tomany tables in db. All tables accept data with no error but payment_agrement table gives me this error:
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (kassemschool.payment_agrements, CONSTRAINT payment_agrements_responisbleid_foreign FOREIGN KEY (responsible_id) REFERENCES payment_agrements (id)) (SQL: insert into payment_agrements (frais_inscription, payment_mois, Assurance, Garde, Transport, responsible_id, updated_at, created_at) values (450, 550, 400, 200, 300, 154, 2019-11-16 19:47:39, 2019-11-16 19:47:39))
This is my controller:
if(request()->has('rName')) {
$responsible = Responsible::create([
'ResponsibleName'=> $request->rName,
'ResponsibleCNI'=>$request->cni,
'responsible_number'=>$request->tele
]);
}
//Student::create($data);
if(request()->has('MontantP')) {
$payment=Payment::create([
'PaymentPaid'=>$request->MontantP,
'PaymentRemaining'=>$request->RestP,
'responsible_id'=>$responsible->id,
]);
}
if($request->hasFile('file')){
$student->images = $request->file->store('file');
}
if(request()->has('TransportR')) {
$transport=Transport::create([
'TransportPaid'=> $request->TransportP,
'TransportRemainning'=>$request->TransportR,
'TransportDateStart'=>$request->TdateStart,
'TransportDateEnd'=>$request->TdateEnd,
]);
}
if(request()->has('edateStart')) {
$payment_date = Payment_Date::create([
'PaymentDateStart'=>$request->edateStart,
'PaymentDateEnd'=>$request->edateEnd,
'payment_id'=>$payment->id,
]);
$letter = 'KassN';
$number =$request->env . 'G';
$number2 = $request->group;
$id='_'.rand();
$random = $letter.$number.$number2.$id;
if(request()->has('fName')) {
$student = Student::create([
'StudentFName'=> $request->fName,
'StudentLName'=> $request->lName,
'StudentDateStart'=>$request->edateStart,
'StudentDateEnd'=>$request->edateEnd,
'level_id'=> $request->env,
'group_id'=>$request->group,
'responsible_id'=> $responsible->id,
'payment_date_id'=>$payment_date->id,
'Payment_dure_id'=>$request->paymentD,
'payment_id'=>$payment->id,
'transport_id'=>$transport->id,
'student_code'=>$random
]);
}
if(request()->has('inscription')){
$agrement= Payment_agrement::create([
'frais_inscription'=>$request->inscription,
'payment_mois'=>$request->payment,
'Assurance'=>$request->assaurance,
'Garde'=>$request->garde,
'Transport'=>$request->fraiTransport,
'responsible_id'=>$responsible->id
]);
}
my create view
#extends('layouts.app')
#section('content')
#if (Route::has('login'))
#auth
#if (session('status'))
<div class="alert alert-success">
{{ session('status') }}
back to <strong>Home</strong>
back to <strong>list</strong>
</div>
#endif
<div class="mr-auto offset-md-1" style="width: 200px;">
<input type="button" class="btn btn-danger btn-sm" name="" value="<- Reteur">
</div>
<div class="card-body">
<div class="container" style="width: 80%;">
<form action="{{url('student')}}" method="POST">
{{ csrf_field() }}
<div class="form-group">
<label for="firstName">First Name </label>
<input type="text" class="form-control" name="fName" id="elastName">
</div>
<div class="form-group">
<label for="lastName">Last name:</label>
<input type="text" class="form-control" name="lName" id="efirstName">
</div>
<div class="form-group">
<label for="responsable">Responsable Name:</label>
<input type="text" class="form-control" name="rName" id="responsable">
</div>
<div class="form-group">
<label for="cni">Responsable CNI:</label>
<input type="text" class="form-control" name="cni" id="cni">
</div>
<div class="form-group">
<label for="nuveau">Niveau:</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="nuveau">Options</label>
</div>
<select class="custom-select" id="nuveau" name="env">
<option selected>Choose...</option>
#foreach($levels as $level)
<option value="{{$level->id}}">{{$level->LevelName}} </option>
#endforeach
</select>
</div>
</div>
<div class="form-group">
<fieldset>
<legend>Aggrement:<hr></legend>
<div class="form-group">
<label for="cni">Frais de inscription:</label>
<input type="text" class="form-control" name="inscription" id="cni">
</div>
<div class="form-group">
<label for="cni">paiement mensuel:</label>
<input type="text" class="form-control" name="payment" id="cni">
</div>
<div class="form-group">
<label for="cni">Frais de Assurance:</label>
<input type="text" class="form-control" name="assaurance" id="cni">
</div>
<div class="form-group">
<label for="cni">Frais de Garde:</label>
<input type="text" class="form-control" name="garde" id="cni">
</div>
<div class="form-group">
<label for="cni">Frais de transport:</label>
<input type="text" class="form-control" name="fraiTransport" id="cni">
</div>
</fieldset>
</div>
<div class="form-group">
<label for="nuveau">Group:</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="group">Options</label>
</div>
<select class="custom-select" id="nuveau" name="group">
<option selected>Choose...</option>
#foreach($groups as $group)
<option value="{{$group->id}}">{{$group->group_name}}</option>
#endforeach
</select>
</div>
</div>
<div class="form-group">
<label for="payment">Payment:</label>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="payment">Options</label>
</div>
<select class="custom-select" id="payment" name="paymentD">
<option selected>Choose...</option>
#foreach($payment_dures as $payment_dure)
<option value="{{$payment_dure->id}}">{{$payment_dure->payment_dure_name}}</option>
#endforeach
</select>
</div>
</div>
<div class="form-group">
<label for="dateStart"></label>
<input type="date" class="#" id="dateStart" style="width: 49%;" name="edateStart">
<label for="dateEnd">au:</label>
<input type="date" class="#" id="dateEnd" style="width: 44%;" name="edateEnd">
</div>
<div class="form-group">
<label for="MontantP">Montant paye:</label>
<div class="input-group mb-3">
<input type="text" class="form-control" name="MontantP" placeholder="" id="MontantP">
<div class="input-group-append">
<span class="input-group-text">DH</span>
</div>
</div>
</div>
<div class="form-group">
<label for="RestP">Rest a paye paye:</label>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="" id="MontantR" name="RestP">
<div class="input-group-append">
<span class="input-group-text">DH</span>
</div>
</div>
</div>
<p>
<a class="btn btn-primary" data-toggle="collapse" href="#multiCollapseExample1" role="button" aria-expanded="false" aria-controls="multiCollapseExample1" style="width: 100%">Bus subscribtion</a>
<div class="row">
<div class="col">
<div class="collapse multi-collapse" id="multiCollapseExample1">
<div class="card card-body">
<div class="form-group">
<div class="form-group">
<label for="TMontantP">Montant paye:</label>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="" id="TMontantP" name="TransportP">
<div class="input-group-append">
<span class="input-group-text">DH</span>
</div>
</div>
</div>
<div class="form-group">
<label for="TRestP">Rest a paye paye:</label>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="" id="TRestP" name="TransportR">
<div class="input-group-append">
<span class="input-group-text">DH</span>
</div>
</div>
</div>
<div class="form-group">
<label for="TdateStart"></label>
<input type="date" class="#" id="TdateStart" style="width: 48%;" name="TdateStart">
<label for="dTateEnd">au:</label>
<input type="date" class="#" id="TdateEnd" style="width: 44%;" name="TdateEnd">
</div>
</div>
</div>
</div>
</div>
</div>
</p>
<br>
<button type="submit" class="btn btn-secondary">Submit</button>
</form>
</div>
</div>
</div>
</div>
</div>
#else
<div class="d-flex justify-content-center text-center">
<div class="alert alert-danger" role="alert" style="width: 70%">
identifié vous d'abord
</div>
</div>
#endauth
#endif
#endsection
Looks like your foreign key constraint isn't setup correctly. From the look of the error you have setup payment_agrements.responsible_id to point to payment_agrements.id instead of responsibles.id.
In the migration for that table, that field probably looks like this:
$table->foreign('responsible_id')->references('id')->on('payment_agrements');
When it should be:
$table->foreign('responsible_id')->references('id')->on('responsibles');

Square Connect Validate Fields

I set up square connect api and my form submits just fine. My problem is I am trying to submit the payment and also email additional information to myself. If everything gets filled out then the code works perfectly but When I call requestCardNonce(event); it only requires the fields to generate the Nonce to be filled in and not the rest of the fields even tho I have them as required. If i remove requestCardNonce(event); all fields are required like they should be. Is there a way i can get validation on all of my fields to work with square connect api?
<form id="nonce-form" action="include/process-card.php" method="post">
<div class="sec1crt-frmlft">
<div class="form-container">
<div class="form-top">
<div class="form-toplft">
<center><img src="images/hdng-icon1.png" class="hdng-icon"></center>
</div>
<div class="form-toprgt">
<p class="txt2-chk">Billing Information</p>
</div>
</div>
<div class="form-content1">
<div class="frmelements">
<label for="FirstName">First Name<span>*</span></label>
<div class="field">
<div class="icon-box">
<center><img src="images/frmicon1.png"></center>
</div>
<input type="text" name="FirstName" class="ft-input" autocomplete="off" id="FirstName" required/>
</div>
</div>
<div class="frmelements">
<label for="LastName">Last Name<span>*</span></label>
<div class="field">
<div class="icon-box">
<center><img src="images/frmicon1.png"></center>
</div>
<input type="text" name="LastName" class="ft-input" autocomplete="off" id="LastName" required/>
</div>
</div>
<div class="frmelements">
<label for="Email">Email <span>*</span> </label>
<div class="field">
<div class="icon-box">
<center><img src="images/frmicon3.png"></center>
</div>
<input type="text" name="Email" class="ft-input" autocomplete="off" id="Email"
pattern="[a-z0-9._%+-]+#[a-z0-9.-]+\.[a-z]{2,3}$" required/>
</div>
</div>
<div class="frmelements">
<label for="Address">Address<span>*</span></label>
<div class="field">
<div class="icon-box">
<center><img src="images/frmicon5.png"></center>
</div>
<input type="text" name="Address" class="ft-input" autocomplete="off" id="Address" required/>
</div>
</div>
<div class="frmelements short1">
<label for="State">State<span>*</span></label>
<div class="field">
<div class="icon-box">
<center><img src="images/frmicon7.png"></center>
</div>
<select name="State" class="ft-input" id="State" class="required" required>
<option value="" onclick="" selected="">Select State</option>
<option value="AL" onclick="">REMOVED TO SHOR</option>
</select>
</div>
</div>
<div class="frmelements short2">
<label for="City">City<span>*</span></label>
<div class="field">
<div class="icon-box">
<center><img src="images/frmicon6.png"></center>
</div>
<input type="text" name="City" class="ft-input" autocomplete="off" id="City" required/>
</div>
</div>
<div class="frmelements short1">
<label for="sq-postal-code">Zip Code <span>*</span></label>
<div class="field">
<div class="icon-box">
<center><img src="images/frmicon8.png"></center>
</div>
<input type="text" name="sq-postal-code" class="ft-input" autocomplete="off" id="sq-postal-code"
pattern="^\d{5}(?:[-\s]\d{4})?$" required/>
</div>
</div>
<div class="frmelements short2">
<label for="Phone">Phone Number <span>*</span></label>
<div class="field">
<div class="icon-box">
<center><img src="images/frmicon4.png"></center>
</div>
<input type="text" name="Phone" class="ft-input" autocomplete="off" id="Phone"
pattern="^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$" required/>
</div>
</div>
</div>
</div>
</div>
<div class="sec1crt-frmrgt">
<div class="form-container">
<div class="form-top">
<div class="form-toplft">
<center><img src="images/hdng-icon2.png" class="hdng-icon"></center>
</div>
<div class="form-toprgt">
<p class="txt2-chk">Payment Information</p>
</div>
</div>
<div class="form-content2">
<div class="lwrform">
<div style="display:block;" id="cardDiv">
<div class="clearall"></div>
<img src="images/cards.png" class="cards">
<div class="clearall"></div>
<div class="frmelements short1">
<label for="sq-amount">Payment Amount<span>*</span></label>
<div class="field">
<div class="icon-box">
<center><img src="images/frmicon9.png"></center>
</div>
<input data-threeds="pan" type="text" maxlength="16" id="sq-amount" name="sq-amount" class="ft-input"
pattern="^[+-]?[0-9]{1,3}(?:,?[0-9]{3})*(?:\.[0-9]{2})?$" required>
</div>
</div>
<div class="frmelements">
<label for="sq-card-number">Card Number<span>*</span></label>
<div class="field">
<input data-threeds="pan" type="text" maxlength="16" id="sq-card-number" name="sq-card-number" class="ft-input noicon"
pattern="^(?:4[0-9]{12}(?:[0-9]{3})?|[25][1-7][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$" required>
</div>
</div>
<div class="frmelements short1">
<label for="sq-expiration-date">Expiration Date<span>*</span></label>
<div class="field">
<input data-threeds="pan" type="text" id="sq-expiration-date" name="sq-expiration-date" class="ft-input noicon" required>
</div>
</div>
</div>
<div class="frmelements short2">
<label for="sq-cvv">CVV<span>*</span></label>
<div class="field">
<input type="text" class="ft-input noicon" name="sq-cvv" id="sq-cvv" maxlength="4"
pattern="^[0-9]{3,4}$" required>
</div>
</div>
<div class="frmelements short2">
<p class="txt4-chk">What is this?</p>
</div>
</div>
<!--
After a nonce is generated it will be assigned to this hidden input field.
-->
<input type="hidden" id="card-nonce" name="nonce">
</div>
<div class="clearall"></div>
<div class="frmelements btn-element">
<input type="submit" value="" id="sq-creditcard" onclick="requestCardNonce(event)"
class="button-credit-card">
</div>
<center><img src="images/postal-crt.png" class="postal-crt"></center>
</div>
</div>
</div>
</form>

Laravel csrf_field() Is Blank

I am learning about Packages in Laravel 5.4 and ultimately I will upload them to github.
This is my directory structure :
laravel
-vendor
--student
---myPackage
----src
-----Views
------myView.blade.php
the myView.blade.php has a form in it, and a {{csrf_field()}} function call, but when I inspect the output in the browser, the value attribute of the hidden input <input name="_token" value="" type="hidden"> is empty.
How do I make this work ?
SOLUTION
Apparantly, I needed to make sure that the web middleware is in use
for my routes, so I changed Route::get('/Register/{group}',
'Student\myPackage\Http\User#create'); to
Route::get('/Register/{group}',
'Student\myPackage\Http\User#create')->middleware('web');
Route:
Route::get('/Register/{group}', 'Student\myPackage\Http\User#create');
Route::post('/Register/{group}', 'Student\myPackage\Http\User#store');
Controller:
public function create($group){
return view('StudentUser::app', ['group' => $group]);
}
public function store($group)
{
dd(request()->all());
}
Form:
<form class="form-horizontal" role="form" method="POST" action="/Register/{{$group}}">
<div class="tab-content">
<div id="ap-about" class="tab-pane active">
{!! csrf_token() !!}
<div class="form-group">
<label for="name" class="col-md-4 control-label">Name</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control" name="name" value="" required autofocus>
</div>
</div>
<div class="form-group">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="" required>
</div>
</div>
<div class="form-group">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password" required>
</div>
</div>
<div class="form-group">
<label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="button" class="btn btn-primary">
Next
</button>
</div>
</div>
</div>
<div id="ap-personal" class="tab-pane">
<div class="form-group">
<label for="address" class="col-md-4 control-label">Address</label>
<div class="col-md-6">
<input id="address" type="text" class="form-control" name="personal[]" value="" required autofocus>
</div>
</div>
<div class="form-group">
<label for="url" class="col-md-4 control-label">url</label>
<div class="col-md-6">
<input id="url" type="text" class="form-control" name="personal[]" value="" required autofocus>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Register
</button>
</div>
</div>
</div>
</div>
</form>

how to save data/records from html form to DB2 database

this is my html form
<form class="form-horizontal" id="myCredantials" >
<div class="form-group">
<label class="col-sm-2 control-label">Username : </label>
<div class="col-sm-10 col-md-2">
<input type="text" class="form-control" id="tbUsername" placeholder="Username">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Email : </label>
<div class="col-sm-10 col-md-2">
<input type="text" class="form-control" id="tbEmail" placeholder="Email">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Gender : </label>
<div class="col-sm-10 col-md-2">
<select id="cbmGender">
<option value="-1">Gender</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Date : </label>
<div class="col-sm-10 col-md-2">
<input type="text" class="form-control" id="tbDate">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Price : </label>
<div class="col-sm-10 col-md-2">
<input type="text" class="form-control" value="0" id="tbPrice" placeholder="Prices">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Perc % : </label>
<div class="col-sm-10 col-md-2">
<input type="text" class="form-control" value="0" id="tbPercentage" placeholder="%">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Password : </label>
<div class="col-sm-10 col-md-2">
<input type="password" class="form-control" id="tbPassword" placeholder="Password">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Confirm Password : </label>
<div class="col-sm-10 col-md-2">
<input type="password" class="form-control" id="tbConfirmpassword" placeholder="Confirm">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="button" class="btn btn-primary " id="btnSubmit" onclick="onSave()" value="Save" >
<input type="button" class="btn btn-primary " id="btnClear" onclick="onClearError()" value="Remove Error" >
<input type="button" class="btn btn-primary " id="btnGet" onclick="doGet()" value="Get" >
<input type="button" class="btn btn-primary " id="btnGet" onclick="doPost()" value="Post" >
</div>
</div>
<div style="width:700px;">
<table cellpadding="0" cellspacing="0" border="0" width="700" id="tbl_Credantials">
</table>
</div>
</form>

Resources