Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

This extension uses request parameters to replace existing parameters. If given value is empty string ('') then parameter will be deleted. This extension will be usefull in situation like pagination, search that you only want to replace only few params instead of all.

Install

<script src="./htmx-ext-replace-params.js">

Usage

Example current page is on /product?page=2&search=meatball. Then this would return /product?page=3&search=meatball.

<div hx-ext="path-params">
  <a hx-get="/product?page=2&search=meatball" hx-vals='{"page": "3"}'>Next</a>
</div>

Another example if current page is on /product?page=2&search=meatball. Then this would return /product?page=2&search=friedchicken

<form hx-ext="path-params" hx-get="/product?page=2&search=meatball">
  <input value="friedchicken" name="search" />
  <button>Search</button>
</form>

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages