this post was submitted on 01 Feb 2025
2 points (100.0% liked)

Perchance - Create a Random Text Generator

529 readers
6 users here now

โš„๏ธŽ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 2 years ago
MODERATORS
 

I am new to this perchance ai image generation, I am trying to experiment, my requirement is like , I am using html editor for css and ui/ux looks and feels and I am using list editor as backend data storage for my input drop-down options.

-----------------------------In List editor ----------------------

I am trying to do define dd1_data (drop-down options). I just followed the examples from different generators

Dd1_data
    Option1= selected option 1
    Option2 = selected option 2

-----------------------------In HTML editor ----------------------

I am trying to reference the above mentioned drop-down details in html editor. I tried alert method which gives me object datatype for dd1_data with no data. Am I missing something?

<select>Dd1_data</select>

Please help me. My question might be dumb , please help me out as a fellow member of culture ๐Ÿซ 

top 4 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 1 points 13 hours ago* (last edited 13 hours ago) (1 children)

You can dynamically create the options with the following:

selectOpts
  [Dd1_data.getPropertyKeys.map(a => `<option value="${Dd1_data[a]}">${a}</option>`).join('')]

output
  [selectEl.value]

Dd1_data
  Option1 = selected option 1
  Option2 = selected option 2

Then on the HTML

<select id="selectEl" onchange="update(out)">[selectOpts]</select>
<p id="out">[output]</p>

A possible problem would be using just the update() instead of specifying an element to update like update(out), in which it would re-display the [selectOpts] in which it would reset the selection.

Here is also a similar solution to a similar problem.

[โ€“] [email protected] 1 points 1 hour ago* (last edited 29 minutes ago)

Sure , thanks for your help . I will try this and let you know the results.

I tried this way , please let me know your thoughts.

--------------------------------------------In List editor -------------------------------

List 
  o1 = option 1
  o2 = option 2
   $output = [this.getPropertyKeys.map(a => `<option value="${this[a]}">${a}</option>`).join('')]
  

--------------------------------------------In HTML editor -------------------------------

<select id="selectEl" onclick = "update(out)">[List]</select>
<p id ="out">[selectEl.value]</p>

Please correct me if I made mistakes, i tried this method because It can be dynamic and much friendly

And second thing is ,it might be dumb but, how do I tell the ai helper to edit the content in list editor instead of html editor. Is it even possible??

[โ€“] [email protected] 1 points 1 day ago (1 children)

Your post is not formatted how you wanted it to be. Maybe use a code block around your code so we can read it easier.

[โ€“] [email protected] 0 points 1 day ago

Sure , I just formatted the question, please read it again, thanks in advance for helping