Session to store temporary data in MVC [closed] - session

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am pretty new to development and MVC. I want to use session to store my data in a multi page survey, (using next and back buttons to save in the last page). Most of the topics for sessions are about login infos. Can any one help me please.

You have to use $_SESSION['YOUR KEY'] = "ANY VALUE";
try this above code it might be help you have to use $_SESSION instead of SESSION.
<input type="radio" value="1" <?php if($_SESSION['YOUR_KEY'] == 1) { echo "selected";} ?> >
<input type="radio" value="2" <?php if($_SESSION['YOUR_KEY'] == 2) { echo "selected";} ?> >
Add the if condition in input radio

Related

Laravel 8 template layout slots vs Laravel old sections, yields and extends? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I'm starting a new project with Laravel 8 and I realised that there is two ways to extends a layout from a view, the first is with the "new" way, using:
New Parent Layout Design
{{-- any other *.blade.php file that wants to inherit base-view.blade.php view --}}
<x-base-view>
{{-- $slot is this everything block --}}
</x-base-view>
While the base-view is the base-view.blade.php blade file that has something like:
{{-- views/base-view.blade.php --}}
<html>
<body>
<div class="content">
{{ $slot }}
</div>
</body>
</html>
And we have this other way:
"Old" Parent Layout Design
The old way consists in using #extends(), #yield(), #section(), to extends, render a section and define a section respectively
My Question
my question is: which is the best option? I mean, what is the advantages of using the first and what is the advantages of using the second?
And more importantly, what is the pitfalls of using the first or the second way?

Develop responsive layouts in angular 2 material using flex layouts [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
How to develop responsive layouts in angular 2 material using flex layouts.
In angular material we use the code below for responsive layouts on desktop & mobile view.
ex.
<div layout="row" layout-xs="column" layout-wrap="" layout-align="center center">
<div flex="33" flex-xs="100">
</div>
<div flex="33" flex-xs="100">
</div>
<div flex="33" flex-xs="100">
</div>
</div>
I am using it at this times. It is really comfortable.
To install it: Click
More info is here: Click
To using it in css with examples: Click
And an online example: Click
You just need to determine where you use flex-container and flex-item class. And you need to set fxLayout and fxLayoutAlign directives true. It handles rest of work.
I use it with #angular 2.4.3

Find xpath element text on scrape [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Need some help on getting the content (text) of the anchor that hold the email address while performing a scrape. I've tried //*[#id="panel"]/p[2]/span[2]/a but my problem is that not always the span appears as the 2nd child. I presume if I could target the element with the href mailto would work but unable to do it.
<div id="panel">
<p>Elements here</p>
<p>
<span class="label">Email:</span>
<span class="content">
<a class="link" href="mailto:someone#website.com">
someone#website.com
</a>
</span>
</p>
<p></p>
</div>
Use contains()
//div[#id="panel"]//a[contains(#href,"mailto:")]

How I will write in a field which is a Read only field [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How I will write in a field which is a Read only field.
Below is my HTML code:
<input id="detlSancOrderDt" class="false hasDatepicker" type="text" value="" readonly="readonly" style="width:100px;text-align:center;" name="detlSancOrderDt" autocomplete="off" tabindex="-1"></input>
Add disabled attribute.
<input id="detlSancOrderDt" ... disabled="disabled"></input>
Edited following Erik Allik's comment.
Hope you need to show the user that the field is readonly in rails. So, if you are using ERB templates you can convert the above given HTML as:
<%= text_field_tag "detlSancOrderDt", nil, class: 'false hasDatepicker', placeholder: 'This field is read only..', readonly: true, style: "width:100px;text-align:center;", autocomplete: "off", tabindex: "-1" %>
Hope it helps :)
this question is not related to ruby or rails.do you want to change value in readonly text field,for that in browser console you inspect the textfield and change the value.
Ex.in firefox browser install firebug and press F12 and inspect the text field and change the value.

Equivalent erb code for html tags [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have a basic HTML code like
<p>
<label for="firstname">Firstname</label>
<input id="firstname" name="firstname" type="text" />
</p>
Can anyone suggest me any equivalent erb code?
Hope, someone will surely help me....
Thanks in advance.
Erb quivalent code :
<p>
<%= label_tag(:first_name, "First Name") %>
<%= text_field_tag(:first_name) %>
</p>
Hope it will help you.
In addition to this, other rails form helpers could be found here.

Resources