Jump to content
UBot Underground

How can I highlight text in a form?


Recommended Posts

I want to be able to highlight certain words or pieces of text in form fields..

 

For example let's say the website has a text box where you write a short description..

 

I want to be able to highlight certain words so that I can then click the 'link' button and make the word or text a URL - in exactly the same way you would make a link on this forum..

 

What's the solution - perhaps some sort of javascript work around?

Link to post
Share on other sites

I gather from the post that it is Javascript, which I guess is a good language to learn after you have HTML down pat.

 

What does the site use if its not HTML? http://imagicon.info/cat/5-34/vbulletin-smile.gif

Link to post
Share on other sites

I think you guys might be missing what I'm saying here..

 

Imagine you are making a bot for this forum - you want to make it so the bot can put in links when it posts.. There is no 'html' button where you can put in raw html code. The only way you can make a link is by highlighting a word then clicking on the 'link' button..

 

How would you go about doing this with ubot? I'm saying that there might be a way you can do it via javascript as there isn't a command (that I'm aware of) that can highlight text in ubot..

 

Any ideas?

Link to post
Share on other sites

I think you guys might be missing what I'm saying here..

 

Imagine you are making a bot for this forum - you want to make it so the bot can put in links when it posts.. There is no 'html' button where you can put in raw html code. The only way you can make a link is by highlighting a word then clicking on the 'link' button..

 

How would you go about doing this with ubot? I'm saying that there might be a way you can do it via javascript as there isn't a command (that I'm aware of) that can highlight text in ubot..

 

Any ideas?

I don't understand question

 

 

__________________

Watch What to Expect When You’re Expecting Online Free

Link to post
Share on other sites

its not html, its likely bbcode. highlight the text, press the anchor tag button. what does it generate?

is it something like this:

 

Some text before [link=http://www.abc.com]abc 123[/link] some text after.

Link to post
Share on other sites

its not html, its likely bbcode. highlight the text, press the anchor tag button. what does it generate?

is it something like this:

 

Some text before [link=http://www.abc.com]abc 123[/link] some text after.

 

Um yeah if it was literally for this forum it would be bbcode..

 

As it happens on other sites I'm using it's actually HTML..

 

but what I want to do is the same for both - I need to highlight a word..

Link to post
Share on other sites

Yeah - I saw that thread - I was hoping there was a javascript work around - something similar to the way people have been 'dragging and dropping' on some sites - this was fixed with javascript

Link to post
Share on other sites

I think you guys might be missing what I'm saying here..

 

Imagine you are making a bot for this forum - you want to make it so the bot can put in links when it posts.. There is no 'html' button where you can put in raw html code. The only way you can make a link is by highlighting a word then clicking on the 'link' button..

 

How would you go about doing this with ubot? I'm saying that there might be a way you can do it via javascript as there isn't a command (that I'm aware of) that can highlight text in ubot..

 

Any ideas?

 

Taking your example of this forum, there are actually two ways to do it

 

1) Create the output with the url bbcode tag in the text or

2) Use the anchor tag button to generate the link

 

Why do you need to highlight text and click a button to generate an anchor tag link in your post? You already know the anchor tag equivalent. You don't need to physically move the mouse, highlight the starting and ending position and then click a button. You just insert the text with bbcode in it.

 

Do you not just want to insert text with anchor tag in it? Is the poster on the website you are trying to submit to forcing you to highlight to generate the anchor tag?

 

What am I missing here?

 

You will need Javascript to pull this off but frankly I dont see why you even need to do so. Perhaps a webpage of where you are trying to post would help?

Link to post
Share on other sites

He is trying to input a link into a field that requires that you highlight the text and then click on the link button to insert the link.

 

These kind of forms are not uncommon and there seems to be no work around.

 

You have to manually highlight the text, then press the insert link and put it in.

 

Ghoast, if you can tell the url or show a screen shot it might clear up some of the confusion...

 

For now, you might just have to enter in a prompt with a pause script button to enter it in.

 

Sorry I couldn't be more helpful.

Link to post
Share on other sites

Taking your example of this forum, there are actually two ways to do it

 

1) Create the output with the url bbcode tag in the text or

2) Use the anchor tag button to generate the link

 

Why do you need to highlight text and click a button to generate an anchor tag link in your post? You already know the anchor tag equivalent. You don't need to physically move the mouse, highlight the starting and ending position and then click a button. You just insert the text with bbcode in it.

 

Do you not just want to insert text with anchor tag in it? Is the poster on the website you are trying to submit to forcing you to highlight to generate the anchor tag?

 

What am I missing here?

 

You will need Javascript to pull this off but frankly I dont see why you even need to do so. Perhaps a webpage of where you are trying to post would help?

 

Yeah, of course this is the obvious answer - this is how I program my bot to do every site.. until you come to a site which does not accept HTML code when posting.. and yes these sites DO exist..

 

Here's some for ya: :)

 

http://www.sweetcircles.com

http://www.4ppl.com

http://www.flixya.com

 

I think this is what OP is talking about

 

Try and post an article over there with <a href=" and you'll see it comes out as plain text.. they don't accept HTML and the only way to get a link is to highlight the word you want and then click the 'hyperlink' button..

Link to post
Share on other sites

He is trying to input a link into a field that requires that you highlight the text and then click on the link button to insert the link.

 

These kind of forms are not uncommon and there seems to be no work around.

 

You have to manually highlight the text, then press the insert link and put it in.

 

Ghoast, if you can tell the url or show a screen shot it might clear up some of the confusion...

 

For now, you might just have to enter in a prompt with a pause script button to enter it in.

 

Sorry I couldn't be more helpful.

 

Hey mate - thanks you're spot on! I'm sure there's some sort of Javascript fix that would work - unfortunately I don't know how to use it - was hoping someone could share some code :P

 

It would make it so much easier to get links from a lot more places - funnily enough it's sometimes hard to find blogs that allow HTML after you've been through the mainstream ones..

Link to post
Share on other sites

If you want to highlight text in a textarea, here's something I cooked up to do so. It will highlight only the first occurrence of the phrase.

 

Tested in Awesomium, Opera 11.6, Firefox 12, IE 9.0

 

Op: Would have been nice if you supplied some URLs to make your question clearer.

  • Like 2
Link to post
Share on other sites
  • 1 month later...
  • 2 weeks later...

I've had the same problem in some websites where is not possible to insert the html, the solution is not to find the way to highlight the word and link it but adding a javascript to dinamically change the value for the textarea where you want to use html, I've used this:

 

document.getElementById('IDFORM').value = 'VALUE TO INSERT';

 

In my case I still have the problem that the new value is not displayed within the form but pushing the button to go back (in the browser inside Ubot) then pushing forward I come back in the same page with the new value added, I think that you just need to send the form even if you don't see the new value and the value will be passed normally to the script.

 

Another note is that when I use the "Run Javascript" function the value to insert MUST be written ALL in a single line and with all the apostrophes (') backslashed (\')

 

I hope it will be usefull!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...