Saturday, April 1, 2023
Learning Code
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
Learning Code
No Result
View All Result
Home JavaScript

Other input value in dropdown box – JavaScript – SitePoint Forums

learningcode_x1mckf by learningcode_x1mckf
January 9, 2023
in JavaScript
0
Time limit for notify – JavaScript – SitePoint Forums
74
SHARES
1.2k
VIEWS
Share on FacebookShare on Twitter


You might also like

4 Packages for Working With Date and Time in JavaScript – MUO – MakeUseOf

Understanding the Power of Proxy in JavaScript – hackernoon.com

JavaScript vs. TypeScript: What's the difference? – TheServerSide.com

This was a subject closed up by no means answered on this:

Hello, I’m in search of a technique of constructing a kind discipline seem (particularly a textbox) upon choice of a selected discipline in a drop down menu, like <choose>.
<script kind=”textual content/javascript”>
operate showfield(identify)
if(identify==’Different’)doc.getElementById(‘div1’).innerHTML = ‘Different: <enter kind=”textual content” identify=”different” />’;
else
doc.getElementById(‘div1’).innerHTML=”;

</script>
<choose identify=”select_opt” id=”select_opt” class=”form-control” onchange=”showfield(this.choices[this.selectedIndex].…

That is the code:

```
<script kind="textual content/javascript">
operate showfield(identify)
	if(identify=='Different')doc.getElementById('div1').innerHTML = 'Different: <enter kind="textual content" identify="different" />';
	else 
		doc.getElementById('div1').innerHTML='';

</script>
<choose identify="select_opt" id="select_opt" class="form-control" onchange="showfield(this.choices[this.selectedIndex].worth)" required> 
	<choice worth="">Please Choose Supply</choice>  
	<choice worth="Search Engine">Search Engine</choice>
	<choice worth="Social Media">Social Media</choice>
	<choice worth="E-Mail Campaigns">E-Mail Campaigns</choice>
	<choice worth="Exhibitions">Exhibitions</choice>
	<choice worth="Different">Different Sources, Please Specify</choice>
</choose>
<div id="div1"></div>

This works positive in that it’ll show a textual content enter field to kind in.

The query I’ve is how does the inputted textual content turn out to be a worth you could enter into the database?

javascript7:

The query I’ve is how does the inputted textual content turn out to be a worth you could enter into the database?

The choose fields and some other info that’s to be added to the database must be wrapped in a form field, in order that the shape’s info will be despatched to some backend code that updates the database.

Paul_Wilkins:

The choose fields and some other info that’s to be added to the database must be wrapped in a form field, in order that the shape’s info will be despatched to some backend code that updates the database.

I understand how to wrap in a kind discipline. Try this on a regular basis and I exploit dropdowns steadily. The worth of that is suppose to be what’s typed within the enter field. However as written, it simply provides the phrase “Different” to the database as a result of that’s the worth.

So, based mostly on that JS, I wasn’t certain how one can take the textual content typed and use that as the worth that goes to the database.


<choice worth="Different">Different Sources, Please Specify</choice>

javascript7:

So, based mostly on that JS, I wasn’t certain how one can take the textual content typed and use that as the worth that goes to the database.

<choice worth="Different">Different Sources, Please Specify</choice>

Give the choice within the HTML code a reputation attribute, and that can be submitted to the database.

Must you add and take away the identify attribute from the choice relying on if that choice is legitimate or not? No you shouldn’t. The choice ought to all the time be submitted to the backend kind, and that sort of resolution must be made by the backend itself.

Why ought to the backend be chargeable for that sort of resolution? As a result of you shouldn’t belief something from the frontend. It’s too simply exploited by every kind of issues. The backend is the place the place dependable choices are made.



Source link

Share30Tweet19
learningcode_x1mckf

learningcode_x1mckf

Recommended For You

4 Packages for Working With Date and Time in JavaScript – MUO – MakeUseOf

by learningcode_x1mckf
April 1, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

4 Packages for Working With Date and Time in JavaScript  MUO - MakeUseOf Source link

Read more

Understanding the Power of Proxy in JavaScript – hackernoon.com

by learningcode_x1mckf
April 1, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Understanding the Power of Proxy in JavaScript  hackernoon.com Source link

Read more

JavaScript vs. TypeScript: What's the difference? – TheServerSide.com

by learningcode_x1mckf
April 1, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

JavaScript vs. TypeScript: What's the difference?  TheServerSide.com Source link

Read more

JetBrains updates IDEs for Java, JavaScript, Ruby – InfoWorld

by learningcode_x1mckf
March 31, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

JetBrains updates IDEs for Java, JavaScript, Ruby  InfoWorld Source link

Read more

Virtru Announces First Ever FIPS 140-2 Validated JavaScript … – GlobeNewswire

by learningcode_x1mckf
March 30, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Virtru Announces First Ever FIPS 140-2 Validated JavaScript ...  GlobeNewswire Source link

Read more
Next Post
Best CPU for Java | WePC

Best CPU for Java | WePC

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related News

Are Javascript Redirects SEO Friendly?

Are Javascript Redirects SEO Friendly?

December 21, 2022
A New Javascript Runtime Fresh Out Of The Oven

A New Javascript Runtime Fresh Out Of The Oven

September 23, 2022
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

You’re One JavaScript Function Call Away From Using (Most) WebR R Functions In Your WebR-Powered Apps/Sites – Security Boulevard

March 22, 2023

Browse by Category

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

RECENT POSTS

  • So why did they decide to call it Java? – InfoWorld
  • Senior Java Developer – IT-Online
  • 4 Packages for Working With Date and Time in JavaScript – MUO – MakeUseOf

CATEGORIES

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

© 2022 Copyright Learning Code

No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#

© 2022 Copyright Learning Code

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?