SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
-
Jun 27, 2006, 12:52 #1
- Join Date
- Aug 2005
- Location
- Belgium
- Posts
- 387
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
onclick remove the text in form + hisde part of form
Hi there
I have this form on my proxy:
Code:<form name="<?php echo $PHProxy->config['proxy_url_form_name'] ?>" method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <input type="hidden" name="<?php echo $PHProxy->config['url_var_name'] ?>" value="" id="url_input" /> <input type="hidden" name="<?php echo $PHProxy->config['flags_var_name'] ?>" value="" /> </form> <form name="<?php echo $PHProxy->config['proxy_settings_form_name'] ?>" method="get" action="" onsubmit="return submit_form();"> <table style="width: 100%"> <tr><td class="option" style="width: 20%">URL</td><td class="option" style="width: 80%"> <input type="text" name="url" size="70" value="" /></td></tr> <?php echo $PHProxy->options_list(true, true) ?> <tr><td class="option" style="width: 20%">New Window</td><td class="option" style="width: 80%"><input type="checkbox" name="new_window" />Open URL in a new window </td></tr> </table> <div style="text-align: center"><input type="submit" name="browse" value="Browse" onclick="return submit_form();" /></div> </form>
Then if you click that box, the text goes away ...
Also that the options aren't visibel, but only the form where you write the url, the other options have to become visibel when you click on a text link "Advanced"
Can someone do this for me please ?
I don't know anything about JS
Tahnks alot
-
Jun 27, 2006, 21:33 #2
- Join Date
- May 2006
- Location
- Ventura, CA
- Posts
- 2,750
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Shove this someplace in the <head> tag:
Code:<script type="text/javascript"> function textClear(element) { if ( element.value != '' ) { element.value = ''; } } </script>
HTML Code:<input type="text" .... onclick="textClear(this);">....
-
Jun 27, 2006, 21:40 #3
- Join Date
- May 2006
- Location
- Ventura, CA
- Posts
- 2,750
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
hmm, actually this was more like it but..
Code:function clearText(element) { if ( !element.was_clicked ) { element.value = ''; element.was_clicked = true; } }
-
Jun 28, 2006, 01:31 #4
- Join Date
- Aug 2005
- Location
- Belgium
- Posts
- 387
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks
but it isn't working
http://myspaceproxy1.com/
I added it, but nothing happens ...
-
Jun 29, 2006, 02:54 #5
- Join Date
- Aug 2005
- Location
- Belgium
- Posts
- 387
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
please someone
?
-
Jun 29, 2006, 06:59 #6
- Join Date
- Jun 2006
- Posts
- 18
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
in the header somewhere stick the following:
HTML Code:<script language="javascript" type="text/javascript"> var is_clicked=false; function clear_input(element){ if (is_clicked) element.value=""; } function show_hide_options(element){ element.style.display=(element.style.display="none"?"block":"none"); } </script>
HTML Code:<input type="text" name="url" size="70" value="" onclick="clear_input(this);is_clicked=true" />
HTML Code:<div id="advanced" name="advanced" style="display:none"> ...insert options... </div>
HTML Code:<input type="button" onclick="show_hide_options(advanced)" value="Advanced" />
good luck
-
Jun 29, 2006, 07:44 #7
- Join Date
- May 2006
- Location
- Ventura, CA
- Posts
- 2,750
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That would work, but you would need to do this instead:
onclick="clear_input(this);if (!is_clicked) { is_clicked=true; }"
-
Jun 30, 2006, 01:15 #8
- Join Date
- Jun 2006
- Posts
- 18
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
y??
it shouldnt matter as it just makes sure that the variable is still set to true, it juts clutters ur code
-
Jul 3, 2006, 17:02 #9
- Join Date
- Jul 2006
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
2 Clicks
I've implemented the most recent code block and I have to click in the input box twice to get the text to disappear. This happens in both IE 7 and Firefox.
-
Jul 6, 2006, 05:08 #10
- Join Date
- Aug 2005
- Location
- Belgium
- Posts
- 387
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I tryed both guys, none of them seems to work for me :s
here they are online: http://www.myspaceproxy1.com/v2/
please help someone?
thanks
Bookmarks