Complex HTML code needed. Do YOU know?

  • 1
  • Question
  • Updated 7 years ago
  • Answered
Okay I need a HTML/Javascript or any type of category the code I need is.

So what I need is a way to edit a code by simply entering what to change it with in a input box. I'll explain.

Let's imagine I have a code on my website like this one:

cat . swf wideness310

And below that code is an input box where I enter something I wish. Example I entered 323 and clicked 'submit'.

and so the code I had above changes to cat . swf widenesss323

*Notice the 'wideness' changed from 310 to 323.
Also keep in mind that's an example code. Note the real one- the real one isnt allowed into here because it doesnt let html codes in.

Is this possible in the world of codes? I hope so. If anyone knows please tell me what code is needed. Thanks.
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes

Posted 7 years ago

  • 1
Photo of Francois

Francois, Employee

  • 282 Posts
  • 19 Reply Likes
Hi Mike,

That sounds like the kind of functionality that you'll get from something like a WYSIWYG HTML editor, but I could be wrong.

Let's see if anybody in the Yola community has some suggestions or feedback.
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hey Mike,

So what you want to do is type in something into the text box and once you click Submit, it will change to what you typed in but only that one part? If you don't know what I mean, I just wrote a JS code that will do what I just explained, and you don't have to submit anything, right when you type, the text changes, it's neat:

http://tester3.yolasite.com/javascrip...

Is this what you wanted? When you type it automatically updates what is in there. You can add code, anything into it. Are you wanting to have the user on your site be able to edit a part of the code or something?

Nathan
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
I want the last option. It's just what I need.
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
When I say second option, I want the user to type in something and it updates the source code.
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Awesome, that'll be easy for me, I'll have it done within an hour! :)
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
Great Nathan. Thanks for the support once again :)

And I'll be waiting :)
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
'kay, I'm waiting :)
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi Mike.

I'm very sorry! I have totally forgot to post the code! This has been much longer than 1 hour... LOL. The code is on this page:

http://tester3.yolasite.com/javascrip...

Just click on the blue "Want the code? Click here!" link.

I added some security to it so only you and people that see this post will be able to get the code :) When you click on "Want the code? Click here!" a lightbox will pop up asking you to enter a password. Just enter in yolarocks123 and click "Submit" to gain access to the code.

I hope this helps.

If you have any troubles with the code, please let me know.

Nathan
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
Yeah it sure was more than one hour :/

But thanks for actually putting the code on anyway :)
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
Hey and about the passcode lightbox, I'm sure it's not javascript, so what's the code for that? Could you tip me on that as well? (If its not javascript, mybad)
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi Mike,

Actually, it is JavaScript :) I know JavaScript isn't the most secure but for that it doesn't have to be that secure as it is just a code.

In that JavaScript I made it hard to find the password with variables.

That lightbox actually looks like a plugin called "fancybox" but it isn't, I created it from scratch.

I'm sorry again for not posting the code that one day.

Sincerely,
Nathan