Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by Nico2011
at 2024-04-07 09:45:57
Point:500 Replies:6 POST_ID:828913USER_ID:11814
Topic:
Cascading Style Sheets (CSS);;Hypertext Markup Language (HTML)
Hello,
I would like to get a DIV to come up when a user clicks the form submit button (SEARCH) on this page.
I have tried, using this code, but it doesn't seem to work (the page works normally but no DIV pops up):
I would like to get a DIV to come up when a user clicks the form submit button (SEARCH) on this page.
I have tried, using this code, but it doesn't seem to work (the page works normally but no DIV pops up):
<input name="searchlocationsrentals" id="searchlocationsrentals" type="submit" class="bindexbuyrent-long" value="SEARCH NOW" align="top" onmouseover="this.style.cursor='pointer'" onclick="document.getElementById('holdpage').style.visibility='block'"/> 1:
Help appreciated! Thanks in advance.
Author: Nico2011 replied at 2024-04-08 01:31:29
thanks - this worked
Expert: xmediaman replied at 2024-04-07 11:03:01
Duh. I didn't notice you had a link to your page. The absence of any value in the action attribute of the form element causes the page to refresh when the submit button is activated. This would cause the element with ID of "holdpage" to return to its default display or visibility. HOWEVER, I can't find an element with ID of "holdpage". Am I missing something?
Expert: duncanb7 replied at 2024-04-07 10:09:56
You can see the difference between display and visibility from the link
http://www.w3schools.com/css/css_display_visibility.asp
and select which one from display or visibility css style you want
Duncan
http://www.w3schools.com/css/css_display_visibility.asp
and select which one from display or visibility css style you want
Duncan
Expert: Scott Fell (padas) replied at 2024-04-07 10:09:26
The code works stand alone as you can see by the sample http://jsbin.com/kupugivo/1/edit?html,output
<!DOCTYPE html><html><head> <script> function showHide(divId){ var theDiv = document.getElementById(divId); if(theDiv.style.display=="none"){ theDiv.style.display=""; }else{ theDiv.style.display="none"; }} </script> <meta charset="utf-8"> <title>JS Bin</title></head><body> <div id="hidethis" style="display:none">Now you see me</div> <button onclick="showHide('hidethis');">Click me</button></body></html> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:
I see you have this code
and
script type="text/javascript">"//<"![CDATA[ Calendar.setup({ inputField : "f_date1", trigger : "f_btn1",// onSelect : function() { this.hide();" document.forms['form1'].submit() }, onSelect : function() { this.hide()}, //showTime : 12, min: 20140407, max: 20150707, fdow: 6, dateFormat : "%d-%b-%Y" });" //]]>"<"/script 1:2:3:4:5:6:7:8:9:10:11:12:
Could one of these be interfering? I also can see an error pop up in the console when you click the search button.
Accepted Solution
Expert: xmediaman replied at 2024-04-07 10:07:47
500 points EXCELLENT
This will not prevent the form from submitting. Do you have an onsubmit event listener on the form element to prevent this? If so, you may be looking for (display instead of visibility):
<input name="searchlocationsrentals" id="searchlocationsrentals" type="submit" class="bindexbuyrent-long" value="SEARCH NOW" align="top" onmouseover="this.style.cursor='pointer'" onclick="document.getElementById('holdpage').style.display='block'"/> 1:2:3:4:
Expert: duncanb7 replied at 2024-04-07 10:00:28
try this
onclick="document.getElementById('holdpage').style.visibility='visible'"
http://www.w3schools.com/cssref/pr_class_visibility.asp
if still no okay, try zIndex to set the div on most top of body page
onclick="javascript:document.getElementById('holdpage').style.visibility='visible';
document.getElementById('holdpage').style.zIndex=999;"
If still in issue, go to chrome browser options-->tools-->developer tools-console
to see and fix all javascript syntax error and send us those error
Hope understand your question completely, if not, please pt it out
Duncan
onclick="document.getElementById('holdpage').style.visibility='visible'"
http://www.w3schools.com/cssref/pr_class_visibility.asp
if still no okay, try zIndex to set the div on most top of body page
onclick="javascript:document.getElementById('holdpage').style.visibility='visible';
document.getElementById('holdpage').style.zIndex=999;"
If still in issue, go to chrome browser options-->tools-->developer tools-console
to see and fix all javascript syntax error and send us those error
Hope understand your question completely, if not, please pt it out
Duncan