afficher un formulaire en fonction du choix de l'utilisateur [closed] - javascript

Closed. This question is not written in English. It is not currently accepting answers.
Stack Overflow is an English-only site. The author must be able to communicate in English to understand and engage with any comments and/or answers their question receives. Don't translate this post for the author; machine translations can be inaccurate, and even human translations can alter the intended meaning of the post.
Closed 3 days ago.
Improve this question
j'ai besoin d'afficher un formulaire en fonction du choix que fera l'utilisateur voila mon code[[[enter image description here](https://i.stack.imgur.com/fIlmi.png)](https://i.stack.imgur.com/TdOZR.png)](https://i.stack.imgur.com/EU0AV.png)
j'ai créer tout d'abord mes formulaires J'ai créer ensuite un formulaire a part pour le select et j'ai poser ma condition sur le choix si l'élément récupérer équivaut a l'index alors j'affiche le formulaire approprié sauf que ça affiche tout mes formulaires en même temps c'est comme si mes conditions ne s'exécutent pas
j'ai besoin d'aide svp

Related

How can I scrape/download many files from a dynamic webpage with a hidden xhtml section?

I am trying to download every CSV file on this site: http://data.cnmc.es/datagraph/jsp/inf_trim.jsp
Each CSV is in a radio button inside a sub-page (not a different site) of that main page (I believe the term used to describe this type of site is 'dynamic'). Example of location of one of the CSV files:
image
Problem:
When I run the following code in python in jupyter notebook in order to find patterns in the html - so that I can automate the file downloading process - only a small part of the html is retrieved.
Code:
import requests
from bs4 import BeautifulSoup
webpage = 'http://data.cnmc.es/datagraph/jsp/inf_trim.jsp'
response = requests.get(webpage)
html = response.text
print(html)
What it retrieves:
...some code above which I have purposefully removed for post...
<noframes>
<h1>Informe Trimestral</h1>
<p>Aplicación de consulta de los informes que elabora trimestralmente la Comisión Nacional de los Mercados y la Competencia (CNMC)) en relación al mercado de las telecomunicaciones en España</p>
<h2>Trimestral IV 2014</h2>
<p>1. DATOS GENERALES DEL SECTOR</p>
<p>2. INFRAESTRUCTURAS</p>
<p>3. COMUNICACIONES FIJAS</p>
<p>4. COMUNICACIONES MÓVILES</p>
<p>5. SERVICIOS DE TELEVISIÓN Y RADIO</p>
<p>6. SERVICIOS MAYORISTAS</p>
<h3>EL SECTOR</h3>
<h2>COMUNICACIONES FIJAS</h2>
<h2>COMUNICACIONES MÓVILES</h2>
<h2>AUDIOVISUAL</h2>
<p>2014 © CNMC Comisión Nacional de los Mercados y de la Competencia.</p>
</noframes>
...some code below which I have purposefully removed for post...
What I can see using 'right-click > inspect' on the site:
image
As you can see, the 'right-click > inspect' html shown is much more extended (i.e. it includes <a> tags to dynamically navigate the page which the code-retrieved html does not).
How can I fetch ALL of the html, including those <a> tags?
I believe the answer/problem may lie in this line of code (complete guess, have no clue really):
image
FYI: please correct me if my strategy is not good. My intention is to get the full webpage html to find a pattern in the html tags that will allow me to automate the process of clicking on each CSV radio button using the selenium library
Thanks for your time
Jaime

handlebars : Ajax datas insertion

EDIT :
The problem is, when my html page is generated by Node/express/hbs, the handlebars parser try to resolve the blocks inside the script tags, it can't so it is just ignoring it, is there a way to make handlebars ignore the content of the script tags ?
Here is my Handlebars template file
<section id="movies-to-sort"></section>
<script id="movies2sort" type="text/x-handlebars-template">
<ul>
{{#movies}}
<li>
<p>{{name}} <small>({{ext}})</small></p>
</li>
{{/movies}}
</ul>
</script>
Then I have this ajax done() function :
.done(function(datas) {
var source = $('#movies2sort').html();
var template = Handlebars.compile(source, {noEscape: true});
$("#movies-to-sort").html(template(JSON.stringify(datas)));
// I have also tried without stringifying the datas
});
Here is the raw datas from the ajax response in firefox
{"movies":[{"name":"8½ - Otto et Mezzo (1963) 720p [MKV Corp].mkv","ext":"mkv"},{"name":"Al Final del Tunel (2016) 720p [MKV Corp].mkv","ext":"mkv"},{"name":"Banshun (Printemps Tardif)(1949) 720p [MKV Corp].mkv","ext":"mkv"},{"name":"Beasts of the Southern Wild (2012) 720p.mkv","ext":"mkv"},{"name":"Cashback (2006) 720p [MKV Corp].mkv","ext":"mkv"},{"name":"Celeste & Jesse Forever (2012) 720p.mkv","ext":"mkv"},{"name":"Citizen Kane (1941) 720p [MKV Corp].mkv","ext":"mkv"},{"name":"Das Boot (1981) [MKV Corp].mkv","ext":"mkv"},{"name":"It's a Wonderful Life (1946) 720p [MKV Corp].mkv","ext":"mkv"},{"name":"Jodaeiye Nader az Simin - Une Separation (2011) 720p.mkv","ext":"mkv"},{"name":"Ne Nous Fâchons Pas (1966) [STEN] 720p by johnchen [MKV Corp].mkv","ext":"mkv"},{"name":"Seven Psychopaths (2012) 720p.mkv","ext":"mkv"},{"name":"Tasogare Seibei (Le Samouraï du Crépuscule)(2002) 720p.mkv","ext":"mkv"},{"name":"The Artist (2011) 1080p [MKV Corp].mkv","ext":"mkv"},{"name":"The Aviator (2004) 720p [MKV Corp].mkv","ext":"mkv"},{"name":"The Big Short - Le Casse du Siècle (2015) 720p [MKV Corp].mkv","ext":"mkv"},{"name":"The Blues Brothers (1980) 720p [MKV Corp].mkv","ext":"mkv"},{"name":"The Bourne Identity (2002) 720p [MKV Corp].mkv","ext":"mkv"}]}
But the only html thing which is inserted in is an empty html list, the {{#movies}}{{/movies}} is always ignored.
<section id="movies-to-sort">
<ul></ul>
</section>
I feel I am very close, but I can't figure out what is wrong, any help/hint will be appreciated.

How do I unescape characters in my API response?

I have built an application that retrieves data from the WP Rest API V2 with AngularJS. The response contains escaped characters like the one below:
"excerpt": {
"rendered": "<p>Når vi handler ind, støder vi på mange forskellige mærkningsordninger, og det kan ofte være svært at finde ud af, hvad de forskellige typer betyder. For at give dig svar på…</p>\n",
"protected": false
},
Is there a way unescape the character in Angular? I have looked at multiple options but none seem to work.
The data is displayed in my view like this:
<div class="titlepane">
<h4 class="posttitle white">
{{posts.title.rendered}}
</h4>
<h4 class="categorytitle white">
{{categories.name}}
</h4>
</div>
You can see the result in the image where the escaped character is shown.
How do I solve this?
I figured it out from another thread. The answer is to use the ng-html-bind.
Like the following:
<h2 class="post__title" ng-bind-html="post.title.rendered"></h2
Then it will show as it is supposed to.

Joomla Modal box popup code works in article, but not in code

This question goes for Joomla developers, or enthusiasts.
Unfortunately there is no way to reproduce this scenario on js fiddle website.
I have the following code:
<!-- AQUI COMEÇA O MODAL POPUP, QUE É O POPUP BUILTIN DO JOOMLA AO ESTILO LIGHTBOX -->
<!-- Esta parte ativa a função -->
<?php JHTML::_('behavior.modal', 'a.modal'); ?><!-- Esta parte utiliza javascript para transformar o layout do popup em um fluido -->
<script>jQuery(document).ready(function($){
var width = $(window).width();
var height = $(window).height();
//ID of container
$('a#modal_info').attr('rel','{handler: "iframe", size: {x: '+(width-(width*0.03))+', y: '+(height-(height*0.20))+'}}');
});</script>
<!-- Esta parte é o Link para fazer a chamada -->
<div class="modal barradofundo" onclick="window.location.href = this.getElementsByTagName('a')[0].href;">
<div id="bf1"><img id="bf1img" src="/images/images201605/Coin-icon-e.png" alt="Dinheiro" border="0"></div>
<!-- Esta parte é o Link para fazer a chamada -->
<div id="bf2"><span>Saia da crise agora mesmo, destaque-se e ganhe muito dinheiro!</span>
</div>
<div id="bf3"><a id="modal_info" href="/va/filetobeloaded.html" class="modal catalogobotao2">SAIBA +</a></div>
</div>
<div class="barradofundoespaco"></div>
What that code does is to open a modal box popup that uses a fluid a layout, in other words, it's like a lightbox that fits window.
Inside that box it loads an external page.
The {source} tag is from Sourcerer Plugin, which is used to load javascript, HTML or php inside any part of the site.
It works just fine when used inside an article, but when I try using it in a custom module, it doesn't work, it not even works on other modules that accept php and HTML.
I have jQuery enabled, properly configured and have not conflicts showing in the console. It looks like it's a problem with the module.
Temporary solution:
Found out that using the <?php JHTML::_('behavior.modal', 'a.modal'); ?> in the index.php file of the template, I was able to put it to work. But the problem is that I can't hack the code, as I'll lose the hack after a system's update.

Facebook share only works with message inside

I'm making a facebook share on my website but it is not working correctly.
I won't share if I dont type a message with it.
It worked once for me without message.
HTML:
Facebook
JS:
$('.faceb').attr('href','https://www.facebook.com/dialog/feed? app_id=894298903965098 &display=popup&caption=HETLANDVAN.EU &name=Nederland, het land van...' + $('.modal-body').text()+ '&description=Klik hier om ook alles over Nederland te weten te komen! &picture=http://i.imgur.com/ROOilRC.png &link=http://hetlandvan.eu &redirect_uri=http://hetlandvan.eu');
$('.modal-body').text() is just a random word.
http://hetlandvan.eu

Categories

Resources