| | |
JavaScript Help with display
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
In one of my previous posts here I got the information on what I had to do. Now I have a similar problem instead of using a button to do that I have 2 links that when clicked will take you to the same page but depending on the link clicked certain options are going to be grayed out.
I just dont know how to get started on this. If any one can show me a good place to start that would be greatly apreciated.
I just dont know how to get started on this. If any one can show me a good place to start that would be greatly apreciated.
Use the disabled attribute.
Start with the basic html portion of a form (named "order"):
Then, in JavaScript, you change the attribute to enable the field:
Start with the basic html portion of a form (named "order"):
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<input type="text" id="quantity" disabled="disabled" />
Then, in JavaScript, you change the attribute to enable the field:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
document.forms.order.quantity.disabled = false;
Daylight-saving time uses more gasoline
Fake the links with form input buttons:
Then use the javascript to first open the window, then enable the proper devices:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<input type="button" id="quantity" name="ONE" onclick="javascript:menu1()" /> <input type="button" id="quantity" name="TWO" onclick="javascript:menu2()" />
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
function menu1(){ theWindow = window.open('theurl.htm', 'theWin', ''); theWin.focus(); document.forms.order.quantity.disabled = false; . . .
Last edited by MidiMagic; May 8th, 2007 at 3:22 pm.
Daylight-saving time uses more gasoline
I have an ASP page that uses
To generate the URL for the links. My problem is that I dont know how to transfer that URL to the javascript function in order for it to display the page. Otherwise when the function opens a new window it tells me to relogin if it just use the "HourMod.asp" as the url. When the page loads the url is suposed to look something like this:
[HTML]http://....... edtemp/HourMod.asp?empid=1&sid=E3BCB8594C5F8EDF7A86CDD50266B6964196[/HTML]
And by the way is there a way of doing this without opening a new window?
Thanks,
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
sub SetHoursMenu() Dim period, empid, url, url2, url3, RS sub_menu = "<div class=""menu"" id=""submenu-hours"">" url = "Hours.asp" url2 = "HourMod.asp" url3 = "HourMod.asp" period = request.QueryString("period") if period <> "" then url = url&"?period="&period end if if IsAdmin then empid = request.QueryString("empid") if empid = "" then Set RS = Conn.Execute("SELECT * FROM users ORDER BY name") empid = RS("id") RS.Close Set RS = nothing end if if InStr(url, "?") then url = url&"&" else url = url&"?" end if url = url&"empid="&empid url2 = url2&"?empid="&empid url3 = url3&"?empid="&empid end if sub_menu = sub_menu&"<span>"&HyperLink(url, "<img src=""logs.gif"" width=""120"" height=""30"" id=""logsbutton"" />")&"</span>" sub_menu = sub_menu&"<span onclick=""javascript:menu1()"">"&HyperLink(url2, "<img src=""img/companyhours.jpg"" width=""120"" height=""30"" id=""addbutton"" />")&"</span>" sub_menu = sub_menu&"<span onclick=""javascript:menu2()"">"&HyperLink(url3, "<img src=""img/noncompanyhours.jpg"" width=""120"" height=""30"" id=""addbutton"" />")&"</span></div>" end sub
To generate the URL for the links. My problem is that I dont know how to transfer that URL to the javascript function in order for it to display the page. Otherwise when the function opens a new window it tells me to relogin if it just use the "HourMod.asp" as the url. When the page loads the url is suposed to look something like this:
[HTML]http://....... edtemp/HourMod.asp?empid=1&sid=E3BCB8594C5F8EDF7A86CDD50266B6964196[/HTML]
And by the way is there a way of doing this without opening a new window?
Thanks,
Last edited by edouard89; May 9th, 2007 at 10:45 am.
You could pass the url as a parameter.
Wouldn't it be easier to just have two versions of the page?
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<input type="button" id="quantity" name="ONE" onclick="javascript:menu1(url1.htm)" /> <input type="button" id="quantity" name="TWO" onclick="javascript:menu2(url2.htm)" />
Wouldn't it be easier to just have two versions of the page?
Daylight-saving time uses more gasoline
Yes it would be a lot easier to make two pages but this is what I have to do. This is what I have done on this
but when I use it with the buttons on the top
It gives me an error saying that either url2 or url3 is undefined. I dont know weather this is because of the way I am using the the url2/url3 as parameters or something else.
I apreciate your help very much thank you.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
response.Write "function menu1(txt)" response.Write "{" response.Write "theWindow=window.open(txt, 'theWin', '');" response.Write "theWin.focus();" response.Write "document.forms.Hours.nonCompany.disabled = true;" response.Write "}" response.Write "function menu2(txt)" response.Write "{" response.Write "theWindow=window.open(txt, 'theWin', '');" response.Write "theWin.focus();" response.Write "document.forms.Hours.nonCompany.disabled = false;" response.Write "document.forms.Hours.nonCompany.checked = true;" response.Write "}"
but when I use it with the buttons on the top
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
sub_menu = sub_menu&"<span onclick=""javascript:menu1(url2)""><img src=""img/companyhours.jpg"" width=""120"" height=""30"" id=""addbutton"" /></span>" sub_menu = sub_menu&"<span onclick=""javascript:menu2(url3)""><img src=""img/noncompanyhours.jpg"" width=""120"" height=""30"" id=""addbutton"" /></span></div>"
It gives me an error saying that either url2 or url3 is undefined. I dont know weather this is because of the way I am using the the url2/url3 as parameters or something else.
I apreciate your help very much thank you.
I am having trouble with the URL bieng used as a parameter. Is there a way that I can use javascript to get a value from vbscript and return that value from the vbscript to be used by the java script?
for example:
The VBfunction would then return a value that would be used to open the new window. Or open the page in the same window?
for example:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<span onclick=""javascript:menu1(VBFUNCTION HERE)"">
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
response.Write "function menu1(txt)" response.Write "{" response.Write "theWindow=window.open(txt, 'theWindow', '');" . . .
The VBfunction would then return a value that would be used to open the new window. Or open the page in the same window?
![]() |
Similar Threads
- how can i make php alert pop ups just like in javascript. (PHP)
- display numbers with comma separator in html (HTML and CSS)
- Javascript/CSS Problem: Display is not properly hiding items (style.display="none") (JavaScript / DHTML / AJAX)
- tag that shows hand on mouseover (JavaScript / DHTML / AJAX)
- convert a file containing javascript to aspx (Community Introductions)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: quick javascript help
- Next Thread: Help using looping in JS
| Thread Tools | Search this Thread |
ajax ajaxcode ajaxhelp ajaxjspservlets animate automatically beta box browser bug calendar captchaformproblem checkbox child class close column cookies createrange() css cursor dependent disablefirebug dom download dropdown editor element engine error events explorer ext file form forms google gwt gxt hiddenvalue highlightedword html htmlform ie8 iframe image() images internet java javascript jawascriptruntimeerror jquery jsf jsfile jump libcurl math matrixcaptcha microsoft mimic object onerror onmouseoutdivproblem onreadystatechange parent pdf php player post problem progressbar rated rating regex runtime scroll search security select session shopping size software sql star stars synchronous text textarea unicode validation w3c web website window windowofwords windowsxp wysiwyg xml \n






