How to automatically fill the input field in HTML formSanitizing a form's database input while retaining...
Difference between 'stomach' and 'uterus'
Is divide-by-zero a security vulnerability?
Can I become debt free or should I file for bankruptcy? How do I manage my debt and finances?
Are small insurances worth it
What are the issues with an additional (limited) concentration slot instead of Bladesong?
Can throughput exceed the bandwidth of a network
Are paired adjectives bad style?
Is there a legal poaching?
Book about a time-travel war fought by computers
For the ranger's Natural Explorer feature, which favored terrain are caves and dungeons classified under?
Real life puzzle: Unknown alphabet or shorthand
Can a space-faring robot still function over a billion years?
Is there any relevance to Thor getting his hair cut other than comedic value?
Where is the fallacy here?
Pure Functions: Does "No Side Effects" Imply "Always Same Output, Given Same Input"?
Levi-Civita symbol: 3D matrix
Why are special aircraft used for the carriers in the United States Navy?
Plagiarism of code by other PhD student
Practical reasons to have both a large police force and bounty hunting network?
Citing contemporaneous (interlaced?) preprints
The need of reserving one's ability in job interviews
Is there a full canon version of Tyrion's jackass/honeycomb joke?
At what level can a party fight a mimic?
Is there a math equivalent to the conditional ternary operator?
How to automatically fill the input field in HTML form
Sanitizing a form's database input while retaining basic HTML markupHow to subtract fields and insert the value in other field automatically?Fill Factor: Will the fill factor change automatically after it detects the changes in the index pages?How the input entered through the front-end form match with the existing data in databaseValidating an HTML input stringHow To Read HTML code as XML and get the output like the sample in sql?Unexpected behavior of the “Money” field in PostgreSQLCREATE DATABASE on RAW partitions no longer works?Variable at the end of HTMLBad query plan only on first execution, not in SSMS
I have a system project where I can create fuel expenses records, I input its data in a HTML form which I can select names directly from database, these names has a car issued by the company and these names has a code names each. what i want is, when I Select a name from data base, i want to AUTOMATICALLY fill the other HTML form with its codename and the plate number of the vehicle,
note that the names and codenames stored in table named tbl_employee while the carid and reg_num(the plate number) stored in tbl_vehicle.
here's my HTML form
<div class="form-group">
<label>Employee Name</label>
<select name="employee" onchange="getEmp(this.value)" class="form-control">
<option value="">Select Employee</option>
<?php foreach($emps as $emp) : ?>
<option value="<?php echo $emp["employee_id"]; ?>"><?php echo $emp["surname"] . ', ' . $emp["firstname"]; ?></option>
<?php endforeach; ?>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Employee Code</label>
<input class="form-control" name="code" type="text"/>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Plate Number</label>
<input class="form-control" name="platenumber" type="text"/>
<div class="help-block with-errors"></div>
</div>
this is the SQL statement I used to call the names and select directly from database
$emp = query("SELECT * FROM tbl_employee");
Please help me what codes to be added to meet my desired output. Many thanks
sql-server php
New contributor
add a comment |
I have a system project where I can create fuel expenses records, I input its data in a HTML form which I can select names directly from database, these names has a car issued by the company and these names has a code names each. what i want is, when I Select a name from data base, i want to AUTOMATICALLY fill the other HTML form with its codename and the plate number of the vehicle,
note that the names and codenames stored in table named tbl_employee while the carid and reg_num(the plate number) stored in tbl_vehicle.
here's my HTML form
<div class="form-group">
<label>Employee Name</label>
<select name="employee" onchange="getEmp(this.value)" class="form-control">
<option value="">Select Employee</option>
<?php foreach($emps as $emp) : ?>
<option value="<?php echo $emp["employee_id"]; ?>"><?php echo $emp["surname"] . ', ' . $emp["firstname"]; ?></option>
<?php endforeach; ?>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Employee Code</label>
<input class="form-control" name="code" type="text"/>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Plate Number</label>
<input class="form-control" name="platenumber" type="text"/>
<div class="help-block with-errors"></div>
</div>
this is the SQL statement I used to call the names and select directly from database
$emp = query("SELECT * FROM tbl_employee");
Please help me what codes to be added to meet my desired output. Many thanks
sql-server php
New contributor
add a comment |
I have a system project where I can create fuel expenses records, I input its data in a HTML form which I can select names directly from database, these names has a car issued by the company and these names has a code names each. what i want is, when I Select a name from data base, i want to AUTOMATICALLY fill the other HTML form with its codename and the plate number of the vehicle,
note that the names and codenames stored in table named tbl_employee while the carid and reg_num(the plate number) stored in tbl_vehicle.
here's my HTML form
<div class="form-group">
<label>Employee Name</label>
<select name="employee" onchange="getEmp(this.value)" class="form-control">
<option value="">Select Employee</option>
<?php foreach($emps as $emp) : ?>
<option value="<?php echo $emp["employee_id"]; ?>"><?php echo $emp["surname"] . ', ' . $emp["firstname"]; ?></option>
<?php endforeach; ?>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Employee Code</label>
<input class="form-control" name="code" type="text"/>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Plate Number</label>
<input class="form-control" name="platenumber" type="text"/>
<div class="help-block with-errors"></div>
</div>
this is the SQL statement I used to call the names and select directly from database
$emp = query("SELECT * FROM tbl_employee");
Please help me what codes to be added to meet my desired output. Many thanks
sql-server php
New contributor
I have a system project where I can create fuel expenses records, I input its data in a HTML form which I can select names directly from database, these names has a car issued by the company and these names has a code names each. what i want is, when I Select a name from data base, i want to AUTOMATICALLY fill the other HTML form with its codename and the plate number of the vehicle,
note that the names and codenames stored in table named tbl_employee while the carid and reg_num(the plate number) stored in tbl_vehicle.
here's my HTML form
<div class="form-group">
<label>Employee Name</label>
<select name="employee" onchange="getEmp(this.value)" class="form-control">
<option value="">Select Employee</option>
<?php foreach($emps as $emp) : ?>
<option value="<?php echo $emp["employee_id"]; ?>"><?php echo $emp["surname"] . ', ' . $emp["firstname"]; ?></option>
<?php endforeach; ?>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Employee Code</label>
<input class="form-control" name="code" type="text"/>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>Plate Number</label>
<input class="form-control" name="platenumber" type="text"/>
<div class="help-block with-errors"></div>
</div>
this is the SQL statement I used to call the names and select directly from database
$emp = query("SELECT * FROM tbl_employee");
Please help me what codes to be added to meet my desired output. Many thanks
sql-server php
sql-server php
New contributor
New contributor
New contributor
asked 5 mins ago
N-JayN-Jay
11
11
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
N-Jay is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231413%2fhow-to-automatically-fill-the-input-field-in-html-form%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
N-Jay is a new contributor. Be nice, and check out our Code of Conduct.
N-Jay is a new contributor. Be nice, and check out our Code of Conduct.
N-Jay is a new contributor. Be nice, and check out our Code of Conduct.
N-Jay is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231413%2fhow-to-automatically-fill-the-input-field-in-html-form%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown