Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Client-side Scripting _ How to make a script code for html

Posted by: amir123 Dec 26 2011, 12:05 AM

Actually i am trying to make a little script for html which can do a little work. like this


IPB Image

when some one insert text into text box then click one Btn one . After a five second Btn two will appears and having a hyperlink of text which i inserted in text box.

what i do.

i just insert a text box in Dreamweaver and two buttons make a little code it works but not make a button two which has a hyperlink of the text which i write in text box.

please help me out .




thanks in advance

Posted by: Darin McGrew Dec 26 2011, 02:56 AM

This is about JavaScript, not markup, so I'm moving it to the client-side scripting forum.

Posted by: Brian Chandler Dec 26 2011, 03:57 AM

QUOTE
After a five second Btn two will appears and having a hyperlink of text which i inserted in text box.


Can you explain what this means? Perhaps if the person types 'google', button B then links to http://google.com... something like that?


Posted by: amir123 Dec 27 2011, 05:37 AM

yes same .......but if i enter other website page it will open it as same like www.google.com/mypage%20xyz ...it will open it as same..


pls tell me what i do

Posted by: Brian Chandler Dec 27 2011, 08:41 AM

First of all you have to make explicit the relationship between what is typed and the address you go to. I can't understand your explanation above.

If the user types X, this goes to http://...<what>... ???

Posted by: amir123 Dec 28 2011, 02:37 AM

simple open <x.com>......... if some one insert some website url then it open as same which inserted in text.....some example here,

if i put only words like xyzkdfid then it open <xyzkdfid.com>


( just insert the .com word in front of word which is not recognize that this is website or any simple word )

if i put www.google.com it open same as <www.google.com>

if i put http://google.com it open same as <http://google.com>

Posted by: amir123 Dec 30 2011, 12:13 AM

please can u tell me what i do ???????????

Posted by: Brian Chandler Dec 30 2011, 09:21 AM

This is so supremely pointless it's hard to have much enthusiasm (after all, the user can simply type the address in the address bar -- which will be *at least* 5 seconds faster!)

But you can write a javascript program:

Use onclick() event of first button to set a timer for 5 seconds (what for????)

(Can't remember details: look up the javascript stuff on timeout?() )

This calls a function to save the calculated address (calcultating this will be fairly hard, actually), and switch on display of the second button.

Use onclick() even of second button to do a location thingy.

Do you know any javascript? If so, off you go; you can always ask specific questions if you get stuck.

If you don't, well you *might* find a script somewhere that does exactly this, though I doubt it. Otherwise you have to pay someone to write it for you.

Hope this helps.

Posted by: amir123 Jan 2 2012, 05:05 AM

Thanks buddy--

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)