Skip to content

New idea for relative link < a > as Control element and as template for form #6784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
korenevskiy opened this issue Oct 30, 2021 · 4 comments

Comments

@korenevskiy
Copy link

korenevskiy commented Oct 30, 2021

I want to offer an idea. Which will have 2 uses.
The idea itself.
Add a relative link format for the A tag.
<a href="@fieldName=Value">link</a>
Specifying the field name.

Now I will list the applications and usage scenarios.
1.Creating new controls using CSS:
Structurally it will look like a <SELECT> control. In this control, you can choose from the following options. But in my example, although it is similar, my solution has no restrictions on the design of the control. With the help of my idea, you can create controls without using JS and without using Web Components, but also with very wide capabilities.
We can set the A tags to any shape, round, triangular, it's like the same thing to have a control with micro-adjustments by design. But now it can be done with my idea.

<input name="color" type="hidden">
<a href="@color=red">Red</a>
<a href="@color=blue">Blue</a>

or

<input name="superCallendar" type="hidden">
<a href="@superCallendar=Past">Red</a>
<a href="@superCallendar=Now">Red</a>
<a href="@superCallendar=Will">Blue</a>

Now we don't need to be able to program Web Components, we can create new controls using CSS and HTML.
Before, we needed to forward data by calling in JS to implement complex controls.

2. We can make templates of filled fields in the link.
having one form, we can create a link by clicking on which all fields for the form will be automatically filled in.
<a href="http://mySite.com/@children=2&@education=hight&@work=full&@city=Berlin&@order=123&@product=Gloves12."> Template of the completed form</a>

After working through this idea, it becomes obvious to me the advantage of this idea, it solves many problems that exist today.
-Solves the problem by creating its own design for existing controls.
-Solves the problem of filling in the form fields. You can create a link with filled in fields for your relative and send him this link via WhatsApp. Your relative (parent) will open the link and click the submit form button.

I suggest using this idea for all types of fields: text, radiobutton, checkbox, select, hidden, number, phone, data, time, and other.
And also come up with an analog of the link in the form of a button.
<button type='value' target='fieldname' value='red'>Red</button>

II And I also want to talk about a new idea here, but it is very closely related to this one.

.
The new idea is that a new magic value could be used for the and tags of the TARGET attribute.
target="_after", target="_before"

<div>
<input type=text name=phone[]>
<label target=_before >You phone</label>
<label target=_before>You phone</label>
</dv><div>
<input type=text name=phone[]>
<label target=_before >You phone</label>
<label target=_before>You phone</label>
</dv>

This benefit will be of great importance when we have many fields with the same names designed as an array. We won't be able to know the exact name of the field, but we know for sure that there are many fields and each has its own description.
Suppose you have a form open in front of you in the likeness of an MS Excel spreadsheet. Suppose there are many radio button switches in one of the columns in each row.
If these switches are arranged as an array, then the radio buttons from each cell will be combined into a common control of the entire table. And our task is to combine radio buttons only for each cell.
If we use one hidden field instead of radio buttons and use several <a> tags with links, then we can create an analogue of radio buttons without combining all into one control, as does a radio button.

for brevity, I will shorten the table tags

<table>
<tr><td> <input type=radio value=1 name=pcs[]> <input type=radio value=2 name=pcs[]> 
<tr><td> <input type=radio value=1 name=pcs[]> <input type=radio value=2 name=pcs[]> 
<tr><td> <input type=radio value=1 name=pcs[]> <input type=radio value=2 name=pcs[]> 
</table>

We can see how the radio buttons have merged into one control.
But

<table>
<tr><td> <input type=hidden value=0 name=pcs[]> <a href=@_after=1> </a> <a href=@_after=2> </a>
<tr><td> <input type=hidden value=0 name=pcs[]> <a href=@_after=1> </a> <a href=@_after=2> </a>
<tr><td> <input type=hidden value=0 name=pcs[]> <a href=@_after=1> </a> <a href=@_after=2> </a>
</table>

As you can see, the functionality of links is similar to radio buttons, but you can create arrays of controls in the likeness of radio buttons and others, and these controls will have a special design.
After that, Chrome developers don't need to develop any fine-tuning controls for existing controls.
I'm sorry, I may have described my idea in a crumpled way. I tried to put the idea briefly.

After thinking of this idea, it's unclear how we didn't think of it before. After all, it's so simple and useful.

The evidence of the benefits is immediately visible.

PS
in case of multiple forms on the page, we can specify the name of the field with the name of the form.
<a href="http://mySite.com/@order.children=2&@order.education=hight&@order.product=Gloves12."> Template of the completed form</a>

Let's divide the idea into 2 parts.
-The benefit of the implementation is to set values by clicking on the active element.
-The method of implementation, perhaps something is incompatible or requires adjustments.
I have already written a similar implementation method here 6463

@Loirooriol
Copy link
Contributor

This would be a breaking change, since URL pathnames can contain @. You probably need something more obscure in order to have web compatibility, e.g. text fragments used #:~:.

But more importantly, the CSSWG is not the right place to discuss this. Your proposal doesn't seem related to CSS at all.

@korenevskiy
Copy link
Author

I created a description here
@Loirooriol , please tell me is this the place where you need to offer ideas?
https://discourse.wicg.io/t/new-idea-for-relative-link-a-as-control-element-and-as-template-for-form/5673

@korenevskiy
Copy link
Author

korenevskiy commented Nov 1, 2021

This would be a breaking change, since URL pathnames can contain @. You probably need something more obscure in order to have web compatibility, e.g. text fragments used #:~:.

But more importantly, the CSSWG is not the right place to discuss this. Your proposal doesn't seem related to CSS at all.

yes, the @ is reserved as a character in the address bar. But the @ is used as a separator of the login and password before the host, if the @ is written after the host, it will simply have a different meaning.

@Loirooriol
Copy link
Contributor

please tell me is this the place where you need to offer ideas?
https://discourse.wicg.io/t/new-idea-for-relative-link-a-as-control-element-and-as-template-for-form/5673

I'm not much familiar with WICG, but it seems so. Note it's not like you can't propose ideas here, but they should be about CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants