Register FAQ/Rules Forum Spy Search Today's Posts Mark Forums Read

Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate.

 
Go Back   Mac Forums > Special Interests > Web Design and Development
TouchArcade.com - iPhone Game Reviews and News

Reply
 
Thread Tools Search this Thread  
Old Jun 4, 2007, 06:25 AM   #1
bahrudeen
macrumors newbie
 
Join Date: Jun 2007
html Hidden tag not working in Mac

Hi..

i m new to Mac... i m developing one intranet application in ASP, when i m using hidden tag in the page its working fine in PC, but not in MAC, first i though its because of javascript, but javascript is working fine like client validation script alert and all fine ...but i found the following is problem

<input type="hidden" value="0" name="CmdAction">

<%Response.Write "<input type=""image"" onClick=""document.getElementById('CmdAction').value = 'Change Password';"" id=""CmdAct"" name=""CmdAct"" src=""images/save.gif"" >" %>


in the above code i m assigning the value to hidden Tag "cmdaction" as "Change Password", after submitting the value is taking to next page for password change.. this page work well in PC, but in Mac the value is not getting.....

strAction = request.Form("CmdAction")

in Mac "strAction " is empty but in PC i m getting "Change Password"

can u help me out in this issue.....


Bahrudeen

Last edited by bahrudeen : Jun 4, 2007 at 06:28 AM. Reason: Text Changed
bahrudeen is offline   Reply With Quote
Old Jun 4, 2007, 06:34 AM   #2
dcv
macrumors 601
 
Join Date: May 2005
Quote:
Originally Posted by bahrudeen View Post
<input type="hidden" value="0" name="CmdAction">

<%Response.Write "<input type=""image"" onClick=""document.getElementById('CmdAction').value = 'Change Password';"" id=""CmdAct"" name=""CmdAct"" src=""images/save.gif"" >" %>

Is it actually finding the 'CmdAction' element?

In the code above you've assigned a name of 'CmdAction' but not an id.
__________________
.
dcv is offline   Reply With Quote
Old Jun 4, 2007, 12:03 PM   #3
jeremy.king
macrumors 601
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
Either add an id attribute to your hidden field, or use

Code:
document.getElementsByName('CmdAction')[0].value
jeremy.king is offline   Reply With Quote
Old Jun 4, 2007, 09:16 PM   #4
angelwatt
macrumors 601
 
Join Date: Aug 2005
Location: Dayton, OH
Quote:
Originally Posted by kingjr3 View Post
Either add an id attribute to your hidden field, or use

Code:
document.getElementsByName('CmdAction')[0].value
Yea, what he said. getElementById looks for the id attribute, not the name attribute. Took me a little bit to see it so I can understand the over site.
angelwatt is offline   Reply With Quote
Old Jun 5, 2007, 01:54 AM   #5
bahrudeen
Thread Starter
macrumors newbie
 
Join Date: Jun 2007
Working...

wow its working....... Thanx guys.....
bahrudeen is offline   Reply With Quote
Old Jun 5, 2007, 09:04 AM   #6
bahrudeen
Thread Starter
macrumors newbie
 
Join Date: Jun 2007
ASP with javascript not working in Mac

hi..

sorry for disturb u again....

i have one input tag , value took from the popup window there by clicking on the text...

<input size=41 type=text class=""text"" readonly name=" & TbFieldName & " value="""& estlocname &"""><input type=hidden id=" & TbFieldName1 & " name=" & TbFieldName1 &" value="""& estlocid &"""><A HREF='javascript:PopWin(""" & TbFieldName & """,""" & TbFieldName1 & """,""Est"")'></a>

by the above code, javascript func for opening one popup..

---------------------
function PopWin(vField, vFieldId, vParam )
{

var nW = window.open("", "popup", "resizable=yes,scrollbars=yes,top=100,left=100,width=650,height=420");
nW.location.href = "popEst.asp?rqFieldName=" + vField + "&rqFieldID=" + vFieldId + "&Param=" + vParam ;
nW = null;

}
-----------------------------

in the popEst.asp page,

im populating all the values from table, if i m click one value from the popup window value should appear in the input tag...

response.write "<td><left><a href=""javascript:sendback('" & replace(EstName,"'","\'") & "', " & EstID & ")"">" & EstName & "</a></left></td>"

function sendback(sWo,sWl,sW2,sW3,sW4)
{

window.opener.document.all.<%=MainFormFldName%>.value = sWo;
window.opener.document.all.<%=MainFormFldID%>.value = sWl;
}

all the code working fine in PC, but not in Mac.. i found that in javascript, ASP variable is not recognize in Mac..

window.opener.document.all.<%=MainFormFldName%>.value = sWo;

in the above line MainFormFldName is showing "varaible undefined" error i m getting when i try to alert the <%=MainFormFldName%> like
alert (<%=MainFormFldName%>);

i dnk i wrote lot, but i want to clearly u my problem...

expecting ur solution......
bahrudeen is offline   Reply With Quote

Reply

Mac Forums > Special Interests > Web Design and Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:45 AM.

Mac News | Mac Rumors | iPhone Game Reviews | iPhone Apps

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2002-2009, MacRumors.com, LLC